na also mit File.ReadAllBytes funktioniert es ohne probleme ....
Hier nochmal der funktionierende upload und download
Upload:
C#-Quelltext
1: 2: 3: 4:
| WebClient request = new WebClient(); request.Credentials = new NetworkCredential("*Benutzername*", "*Passwort*"); byte[] fileData = File.ReadAllBytes("hallo.txt"); request.UploadData("ftp://*Server*/files" + "/" + "MyFile.txt", fileData); |
warum so kompliziert?? funktioniert doch mit 4 zeilen
Download
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| WebClient request = new WebClient(); request.Credentials = new NetworkCredential("*Benutzername*", "*Passwort*");
byte[] fileData = request.DownloadData(@"ftp://*Server*/files" + "/" + "MyFile.txt");
FileStream file = File.Create(@"C:\test2" + "\\" + "MyFile.txt");
file.Write(fileData, 0, fileData.Length); file.Close(); |
im internet waren immer so komplizierte beispiele .... kein wunder warum ich da nicht mehr durchgestiegen bin.
ich bedankt mich erst mal (ganz besonders bei Kha):
Danke für alles ...