您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關如何進行VB.NET實現登陸Ftp的分析,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
今天VB.NET實用教程教你對于VB.NET實現登陸Ftp的方法,快看看學習一下吧。我們都知道遠程視頻傳輸可以采用線程下載、圖片壓縮,還可以考慮先儲存進數據庫中
VB.NET實用教程代碼:
Private sckConnect As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Private RemoteIp As IPEndPoint Private thd As Thread Private blnExt As Boolean = True Private _Quality As Int16 = 50 Public WriteOnly Property Quality() As Int16 ’這個函數表示服務器要求的圖片質量 Set(ByVal value As Int16) _Quality = value End Set End Property Private Sub run() Dim byt() As Byte Dim stream As MemoryStream Dim bmp As Bitmap While blnExt Try bmp = getGrcToBmp() '這是獲取圖片 stream = New MemoryStream Compress(bmp, stream, _Quality) '這里對圖片進行壓縮函數 byt = stream.ToArray sckConnect.Send(byt, byt.Length, SocketFlags.None) byt.Initialize() stream = Nothing Thread.Sleep(30) '30毫秒,也就是1秒中傳送33次圖片 Catch ex As Exception Call Ext() End Try End While End Sub Public Sub Send(ByVal ip As String, ByVal port As Integer) '服務器的IP和Port Try RemoteIp = New IPEndPoint(IPAddress.Parse(ip), port) sckConnect.SendTimeout = 100 sckConnect.Connect(RemoteIp) If sckConnect.Connected Then thd = New Thread(AddressOf run) thd.Start() End If Catch ex As Exception MsgBox(ex.Message) Exit Sub End Try End Sub Public Sub Ext() Try blnExt = False thd = Nothing sckConnect.Disconnect(True) sckConnect.Close() Catch ex As Exception End Try End Sub
上述就是小編為大家分享的如何進行VB.NET實現登陸Ftp的分析了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。