Hallo,
ich habe da ein Problem...
eigentlich klappt es immer bei mir ne ftp verbindung herzustellen doch jetzt bei meinem neuen programm kommt die meldung: Die Verbindung mit dem Remoteserver kann nicht hergestellt werden.
ich stelle mal meinen code rein: speziell die zeile wo diese meldung auftritt.
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
| FtpWebRequest req = (FtpWebRequest)WebRequest.Create(url); req.Method = WebRequestMethods.Ftp.DownloadFile; req.Credentials = new NetworkCredential(username, password); req.UseBinary = true;
using (WebResponse resp = req.GetResponse()) { using (Stream respStream = resp.GetResponseStream()) { Byte[] buffer = new Byte[4096]; int count; using (FileStream f = new FileStream(filename, FileMode.Append)) { do { count = respStream.Read(buffer, 0, buffer.Length); if (count > 0) { f.Write(buffer, 0, count); } } while (count > 0); } } } |
was ich abholen möchte ist eine ".log" datei, welche dort auf C:/ liegt..
kann mir da jemand nen rat geben?
gruß jessy
Moderiert von Christian S.: Code- durch C#-Tags ersetzt