使用Compact Framework和OpenNETCF.Net.Ftp lib
时遇到问题我上传文件打开ftp(web中的测试服务器)并尝试连接到ftp并读取数据,但有异常。 例如ftp://ftp.asu.ru/ 也许是谁知道我的问题??? 我的代码和截图:
//I use any open ftp and any file for test
Uri uri = new Uri(@"ftp://ftp.asu.ru/incoming/01/WebApp.zip");
FtpRequestCreator creator = new FtpRequestCreator();
FtpWebRequest.RegisterPrefix("ftp:", creator);
//right here, when create object, i think that i have a some problem - scr one
FtpWebRequest fwr = (FtpWebRequest)WebRequest.Create(uri);
fwr.Passive = true;
try
{
using (
//Exception to here - scr 2, 3
FtpWebResponse response = (FtpWebResponse)fwr.GetResponse())
...
堆栈追踪:
Exception NullReferenceException: at
OpenNETCF.Net.Ftp.FtpWebRequest.SendCommand(String method, String parameter) at
OpenNETCF.Net.Ftp.FtpWebRequest.OpenPassiveDataConnection() at
OpenNETCF.Net.Ftp.FtpWebRequest.OpenDataConnection() at
OpenNETCF.Net.Ftp.FtpWebRequest.GetResponse() at
WmAutoUpdate.TransferManager.downloadFile(String url, Stream& s, String path, TransferProgress del) at
WmAutoUpdate.Updater.CheckForNewVersion() at
WmAutoUpdateExample.Program.Main()
我没有声望,你可以在这里看到所有图片 http://www.cyberforum.ru/csharp-net/thread1277137.html