質問する
2535 次
1 に答える
1
You're constructing the URL a bit wrong, you're missing a /
before the file name, should probably be like this;
FtpWebRequest ftpRequest =
(FtpWebRequest)WebRequest.Create(@"ftp://110.123.1.23/ABCD/” + file.Name);
You're also not storing in the same directory as your interactive example;
ftp> cd ABCD
ftp> put c:/sample.txt ABCD/XYZ
will store the file XYZ in the directory ABCD/ABCD, not just ABCD as in your URL example.
Thirdly, if you're using .NET 4.0 or higher, you may be bitten by this changed behavior in how directories are sent to the server.
于 2012-09-01T11:15:59.470 に答える