请问各位大侠(关于通过Modem如何上传文件?)

000168 2003-11-28 09:45:59
我的ftp已经实现通过局域网上传文件到服务器了,可是要怎么样才能通过Modem上传呢?好象是用"rasdial",可是不知道怎么用,有人用过吗?最好是有现成的例子,在那可以找到有关这方面的例子?就快交差了,请各位大侠帮帮忙,小弟感激不尽。
...全文
73 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
NetAnt007 2003-11-29
  • 打赏
  • 举报
回复
up,和猫有什么关系马?不懂。
帮你up
000168 2003-11-29
  • 打赏
  • 举报
回复
下面是部分程序,要如何更改才能实现呢?(我的modem已调好)
while(true)
{
try
{
//航危报报文文件目录
DirectoryInfo dir_fb = new DirectoryInfo("d:\\hnny");
FileInfo[] file_fb = dir_fb.GetFiles("*.*");

int i;
string file_name="";
bool check_time1;
FileInfo file_info;
System.DateTime ft1,ft2;
for(i=0;i<file_fb.Length;i++)
{
file_name=file_fb[i].ToString();
//MessageBox.Show(file_name);
if(System.IO.File.Exists("d:\\hnny1\\"+file_fb[i])==false) //文件不存在
{
System.IO.File.Copy("d:\\hnny" + "\\" + file_fb[i], "d:\\hnny1\\"+ file_fb[i],true);
FTPFactory ff = new FTPFactory();
ff.setDebug(true);
ff.setRemoteHost("172.22.68.4");
ff.setRemoteUser("webipp");
ff.setRemotePass("");
ff.login();
ff.chdir("bt\\hnny");


ff.upload("d:\\hnny\\"+file_name);
ff.close();
}
else
{
//比较文件大小和时间
ft1=System.IO.File.GetLastWriteTime("d:\\hnny\\"+file_fb[i].Name);
ft2=System.IO.File.GetLastWriteTime("d:\\hnny1\\"+file_fb[i].Name);
check_time1=System.DateTime.Equals(ft1,ft2);
file_info=new FileInfo("d:\\hnny1\\"+file_name);
//MessageBox.Show(file_name+" "+check_time1.ToString()+" "+check_time2.ToString());
if(check_time1==true && file_fb[i].Length==file_info.Length) continue;
else if(check_time1==false && file_fb[i].Length==file_info.Length)
{
System.IO.File.Copy("d:\\hnny" + "\\" + file_fb[i], "d:\\hnny1\\"+ file_fb[i],true);
FTPFactory ff = new FTPFactory();
ff.setDebug(true);
ff.setRemoteHost("172.22.68.4");
ff.setRemoteUser("webipp");
ff.setRemotePass("");
ff.login();
ff.chdir("bt\\hnny");


ff.upload("d:\\hnny\\"+file_name);
ff.close();
}
else if(check_time1==false && file_fb[i].Length!=file_info.Length)
{
System.IO.File.Copy("d:\\hnny" + "\\" + file_fb[i], "d:\\hnny1\\"+ file_fb[i],true);
FTPFactory ff = new FTPFactory();
ff.setDebug(true);
ff.setRemoteHost("172.22.68.4");
ff.setRemoteUser("webipp");
ff.setRemotePass("");
ff.login();
ff.chdir("bt\\hnny");


ff.upload("d:\\hnny\\"+file_name);
ff.close();
}

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧