ftp FtpWebRespose.GetRespone() Exception
-
I'm using local ftp -using windows XP- I can access it through my browser ftp://localhost/ but when I'm trying to access it through my C# program I had an exception and here is my code FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://localhost/"); request.Method = WebRequestMethods.Ftp.UploadFile; //request.Credentials = new NetworkCredential("anonymous", // "janeDoe@contoso.com"); request.Credentials = new NetworkCredential(username, password); StreamReader sourceStream = new StreamReader(filePath); byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd()); sourceStream.Close(); request.ContentLength = fileContents.Length; Stream requestStream = request.GetRequestStream(); requestStream.Write(fileContents, 0, fileContents.Length); requestStream.Close(); FtpWebResponse response = (FtpWebResponse)request.GetResponse(); I get an "Invalid URI" at request.GetResponse() so can anyone figure what am doing wrong thanks in advance "Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure" -Nelson Mandela-