网站导航网学 原创论文 原创专题 网站设计 最新系统 原创论文 论文降重 发表论文 论文发表 UI设计定制 论文答辩PPT格式排版 期刊发表 论文专题
返回网学首页
网学原创论文
最新论文 推荐专题 热门论文 论文专题
当前位置: 网学 > 交易代码 > ASP.Net精品代码 > 正文

ftp操作实现类

论文降重修改服务、格式排版等 获取论文 论文降重及排版 论文发表 相关服务
t;)

  index2 = m_sReply.IndexOf(")")

  ipData = m_sReply.Substring(index1 + 1, index2 - index1 - 1)

  len = ipData.Length

  partCount = 0

  buf = ""

  For i = 0 To ((len - 1) And partCount <= 6)

  ch = Char.Parse(ipData.Substring(i, 1))

  If (Char.IsDigit(ch)) Then

  buf += ch

  ElseIf (ch <> ",") Then

  MessageString = m_sReply

  Throw New IOException("Malformed PASV reply: " & m_sReply)

  End If

  If ((ch = ",") Or (i + 1 = len)) Then

  Try

  parts(partCount) = Int32.Parse(buf)

  partCount += 1

  buf = ""

  Catch ex As Exception

  MessageString = m_sReply

  Throw New IOException("Malformed PASV reply: " & m_sReply)

  End Try

  End If

  Next

  ipAddress = parts(0) & "." & parts(1) & "." & parts(2) & "." & parts(3)

  port = parts(4) << 8

  ' Determine the data port number.

  port = port + parts(5)

  s = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)

  ep = New IPEndPoint(Dns.Resolve(ipAddress).AddressList(0), port)

  Try

  s.Connect(ep)

  Catch ex As Exception

  MessageString = m_sReply

  Throw New IOException("Cannot connect to remote server")

  'If you cannot connect to the FTP

  'server that is specified, make the boolean variable false.

  flag_bool = False

  End Try

  'If you can connect to the FTP server that is specified, make the boolean variable true.

  flag_bool = True

  Return s

  End Function

  #End Region

  End Class

  • 下一篇资讯: 数据库操作通类实现
  • 设为首页 | 加入收藏 | 网学首页 | 原创论文 | 计算机原创
    版权所有 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2020 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号 常年法律顾问:王律师