transfer files from windows to linux?
I'm trying to connect to a linux machine via pLink and PuTTY to transfer some .txt file. Right now I'm just trying to make the connection work. I have a small window with 2 textboxes (username,linux1) and a password box (pwbox1), and a button that when you click, it should connect you to the linux machine!
Here's my code:
private void button1_Click(object sender, RoutedEventArgs e) { string user = username.Text; string passw = pwbox1.Password; string linuxHst = linux1.Text; ProcessStartInfo psi = new ProcessStartInfo(@"C:\Program Files (x86)\PuTTY\plink.exe", user + "@" + linuxHst + " -pw " + passw); psi.RedirectStandardInput = true; psi.RedirectStandardOutput = true; psi.WindowStyle = ProcessWindowStyle.Normal; psi.UseShellExecute = false; psi.CreateNoWindow = false; Process process = Process.Start(psi); process.WaitForExit(5000); }
The problem is that when I try this with the console application it works, without the textboxes! but I need it to work with WPF. Can anyone please tell me what I'm doing wrong? am I missing something?