-
June 22nd, 2012, 06:02 AM
#1
nbtstat inclution
Hi all,
i've managed to include nbtstat in a program i'm working on, but there's something not working as it should.
When i run nbtstat from my program, it starts, but shows no output to my console app. Ofcourse it does show output from the cmd line.
I also tried writing the output to a text file, but the file is empty after running nbstat -A ip
This is how i use the function:
Code:
void nbtstat()
{
string user_input, lookup_again;
do {
system("cls");
cout << "\nEnter URL or IP: ";
cin.ignore(256,'\n');
getline(cin, user_input);
user_input.erase(remove_if(user_input.begin(), user_input.end(), IsSpaceOrCR), user_input.end());
system("cls");
// Without the redirection to test.txt, the screen stays empty in the app.
system(("C:\\Windows\\System32\\nbtstat.exe -A " + user_input + " > %TEMP%\\test.txt").c_str());
system("pause"); // Only for debugging purpose.
cout << "Done." << endl;
cout << "\nTry again?" << endl;
cout << "\n(Y)es or (N)o: ";
cin >> lookup_again;
} while(lookup_again=="Y" || lookup_again=="Yes" || lookup_again=="y" || lookup_again=="yes");
}
Any ideas ? Or maybe a different way to get the information i need without nbtstat but with a C++ function ?
-
June 22nd, 2012, 07:31 AM
#2
Re: nbtstat inclution
I don't know which function that does the same as nbstat but here's a link to a bunch of network functions http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
-
June 28th, 2012, 02:31 AM
#3
Re: nbtstat inclution
Originally Posted by S_M_A
thanks for the link.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|