abburi chowdary

abburi chowdary

  • NA
  • 60
  • 14.9k

how can we upload path using C# openfile dial/folder browser

Apr 27 2018 7:39 AM
i have written below code to upload path and get path name in the text box, but i am getting exception i.e occurred during a web client request..
  1. WebClient wc = new WebClient();  
  2. Uri addy = new Uri(@"http://192...../gethos_test.php?"+fileName);  
  3. NetworkCredential nc = new NetworkCredential("name""passowrd");  
  4. wc.Credentials = nc;  
  5. byte[] arrReturn = wc.UploadFile(addy, textBox1.Text);  
  6. wc.Dispose();  
  7. String directoryPath=Path.GetDirectoryName(fileName);  
  8. {  
  9. Uri url = ((WebBrowser)sender).Document.Url;  
  10. textBox1.Text = url.ToString();  
  11. }  
  12. MessageBox.Show(arrReturn.ToString());  
  13. }  
  14. catch(Exception E)  
  15. {  
  16. MessageBox.Show(E.Message);  
  17. }  

Answers (1)