这是什么原因呢?急呀!
解决方案 »
- C#如何将一个DataTable中满足条件的数据导入另一个DataTable
- asp c#设计页面指定内容打印如何实现
- winfrom与flash
- 如何播放资源文件中的MIDI音乐?
- 请问如何使用Aximp.exe将现有的OCX控件转换成windows窗体可识别的form控件?
- 我想问一下。在异步socket下如何解决TCP无边界问题!
- 在vs2005中ASP.NET Web Appliation项目模板项在哪?
- 菜鸟问题:怎样在窗体上添加一条分割线
- C# 如何 使用CORBR与C++通信有人做过吗,跪求
- 新手的问提:请问如何实现DataGrid中新增一行后的数据更新,如何获得当前鼠标做在位置的值!
- ASP.net如何通过客户端文件路径读取客户端文件的问题
- 请诸位解释下c#2.0的迭代器,谢谢
#region Exernal Functions
[DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern string NewGetMessage(); [DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern bool NewSetWorkDirectory(string strFile); [DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern void NewLogOffServer(); [DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern bool NewDelFile(string strFliePath); [DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern bool NewMoveFile(
string strRemoteFile,
string strLocalFile,
bool bPasv,
bool bGet
); [DllImport("FtpDLL.dll", SetLastError=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi)]
private unsafe static extern bool NewLogOnToServer(
StringBuilder hostname,
int hostport,
string username,
string password,
string acct,
string fwhost,
string fwusername,
string fwpassword,
int fwport,
int logontype
);
#endregion 调用
try
{
StringBuilder strHost = new StringBuilder(remoteHost, 256); if(!NewLogOnToServer(
strHost,
Convert.ToInt32(remotePort),
remoteUse,
remotePas,
"",
"",
"",
"",
Convert.ToInt32(remotePort),
0
))
{
throw new Exception("不能连接ftp服务器:" + remoteHost + "\n");
} if(NewSetWorkDirectory("\\" + remotePath + "\\"))
{
NewMoveFile(remotefile,localfile,false,false); //upload
}
NewLogOffServer();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
===============================
remoteHost ???