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..
- WebClient wc = new WebClient();
- Uri addy = new Uri(@"http://192...../gethos_test.php?"+fileName);
- NetworkCredential nc = new NetworkCredential("name", "passowrd");
- wc.Credentials = nc;
- byte[] arrReturn = wc.UploadFile(addy, textBox1.Text);
- wc.Dispose();
- String directoryPath=Path.GetDirectoryName(fileName);
- {
- Uri url = ((WebBrowser)sender).Document.Url;
- textBox1.Text = url.ToString();
- }
- MessageBox.Show(arrReturn.ToString());
- }
- catch(Exception E)
- {
- MessageBox.Show(E.Message);
- }