TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yokzu
NA
306
0
Logging remote server with "net use" command
Sep 29 2011 4:48 AM
hello,
I want to log into a remote server and create a text file on there. When I run these command below into "cmd.exe" and then I use to login to server from my computer, it is successfull,
--------------------
net use \\192.168.1.1 pass.123 /user:admin
--------------------
After I run this command from "cmd.exe", I am able to login to server from windows' "run" menu."\\192.168.1.1". I mean this code makes available to log into this server.
But I want to run these command from my program but I couldnt be able to it. My all codes are below but it isnt seems to works. Because I am not able to log into server manually after I run these codes;
-------------------
string parametre1 = "/C net use \\192.168.1.1 pass.123 /user:admin";
Process islem = new Process();
islem.StartInfo.FileName = "C:\\Windows\\System32\\cmd.exe";
islem.StartInfo.Arguments = parametre1;
islem.StartInfo.RedirectStandardOutput = true;
islem.StartInfo.UseShellExecute = false;
islem.Start();
string output = islem.StandardOutput.ReadToEnd();
islem.WaitForExit();
textBox2.Text += output;
-------------------
How can I do that?
I hope I can explain myself. If there is questions in your mind, please ask me.
Reply
Answers (
2
)
Mobile tutorial in c#
Custom Validator not working *** FIXED ***