System.Runtime.InteropServices.SEHException异常,,,,郁闷死~~~

taoyi 2005-03-30 01:53:33
try
{
if (host.Length() == 0)
return false;
if (user.Length() == 0)
return false;
if (password.Length() == 0)
return false;
if (port == 0)
port = 21;

Host = host;
Port = port;
UserID = user;
Password = password;

pFtp->Host = Host;
pFtp->Port = Port;
pFtp->UserID = UserID;
pFtp->Password = Password;

pFtp->Connect();

this->Connected = true;

return this->Connected;
}catch(Exception &e)
{
MessageBox(NULL, (e.Message + "[Host=" + Host
+ " user=" + UserID + " password=" + Password).c_str(), "异常",
MB_OK);
return false;

}


求助~~,以上代码用C#调用后总是出现System.Runtime.InteropServices.SEHException异常,异常信息为外部组件发生异常

哪位老大救救偶啊~~~,偶想跳楼~
...全文
298 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
singleflower 2005-03-30
  • 打赏
  • 举报
回复
直接用C#写吧
tangyong12 2005-03-30
  • 打赏
  • 举报
回复
你这是调用C++的非托管代码吧.怎么不直接用C#写呢?

111,093

社区成员

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

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

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