ok... i never thought about that! im new to FTP so im learning a little at a time... I found ways to do FTP in VC++ and C#, but couldn't find anything for C++ on MSDN
ok... i never thought about that! im new to FTP so im learning a little at a time... I found ways to do FTP in VC++ and C#, but couldn't find anything for C++ on MSDN
When I joined the Core, We didnt have any fancy Shmancy tanks! We had Sticks, TWO sticks and a rock for a whole platoon, And we had to share the rock! -- Sarge
My Other Name Is WarhawkThey Just Didn't let Me Have That Name...
while were talking about FTP, if you connect through FTP to astecinc.95mb.com and put in username astecinc.95mb.com, it brings up the password input... when you type stuff, the cursor never moves -- I dont want to do that but I do want to mask the text with asteriks... I can do this in HTML and in JavaScript, but can someone give me pointers? I'm researching right now and if i find something, I'll post for you guys...
When I joined the Core, We didnt have any fancy Shmancy tanks! We had Sticks, TWO sticks and a rock for a whole platoon, And we had to share the rock! -- Sarge
My Other Name Is WarhawkThey Just Didn't let Me Have That Name...
nazca -- thanks soooo much, but actually -- you don't need the extension to be .ftp, it needs to be .txt, but thanks for the advise! now back to character masking...
I made a code using that principle, but i need help on how to get rid of the file -- see the code and i marked the files in red that need to be deleted before the program ends... I know that you use the "ios::trunc" function, but how do i use it?
Do I need to classify another ofstream x_file?Code:#include <iostream> #include <stdlib.h> #include <string> #include <windows.h> #include <fstream> using namespace std; int main() { system("title Demo Project For cprogramming.com!"); string info; cout << " Please Enter Your Name: "; cin >> info; ofstream a_file ("info_name.txt", ios::app); a_file << info; a_file << endl; a_file.close(); ofstream b_file ("ftpsend.txt"); b_file << "o" << endl; b_file << "your.FTP.com" << endl; b_file << "your.Username" << endl; b_file << "your.Password" << endl; b_file << "send info_name.txt" << endl; b_file << "bye" << endl; b_file.close(); system("ftp -s:ftpsend.txt"); system("cls"); cout << " Press [Enter] To Exit This Program!" << endl; cin.get(); }
Last edited by Halo2Master; 08-03-2005 at 05:06 PM. Reason: error
When I joined the Core, We didnt have any fancy Shmancy tanks! We had Sticks, TWO sticks and a rock for a whole platoon, And we had to share the rock! -- Sarge
My Other Name Is WarhawkThey Just Didn't let Me Have That Name...
I'm sure there's a much, much less hacky way to do it but as far as what you're asking goes:
If you ask me, while you're using system calls you might as well useCode:a_file.close(); b_file.close(); ofstream clearThis("info_name.txt", ios::trunc); ofstream thisToo("ftpsend.txt", ios::trunc); clearThis << endl; // not sure if it's necessary but figure it'll make sure everything's cleared thisToo << endl; clearThis.close(); thisToo.close();
Which will actually destroy the files instead of emptying them. There's probably an ANSI standard way to do it, too.Code:system("del info_name.txt"); system("del ftpsend.txt");
Btw - on my box, files with the ".ftp" extension will work, but those with ".txt" will not. Strange. Maybe I mixed it up?
Last edited by Nazca; 08-03-2005 at 11:52 PM.
hmmm... good point. I tried using the first method before i posted the question but it didnt do anything...
Now back to the masking issue... I found a way to do it through VC++ and VB, and i did find one way to do it through C++ but i cant get it to work anymore... i talked with another guy who said to use a combo of "\b" which is backspace and a find x,y function... basically telling the computer to backspace and replace the character with an asterisk (*) but hold the data using virtual memory, or something like that.
Can someone clear this up for me?
Last edited by Halo2Master; 08-04-2005 at 06:21 PM. Reason: bored
When I joined the Core, We didnt have any fancy Shmancy tanks! We had Sticks, TWO sticks and a rock for a whole platoon, And we had to share the rock! -- Sarge
My Other Name Is WarhawkThey Just Didn't let Me Have That Name...