您好,登錄后才能下訂單哦!
這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)如何進(jìn)行VB.NET實(shí)現(xiàn)登陸Ftp的分析,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
今天VB.NET實(shí)用教程教你對(duì)于VB.NET實(shí)現(xiàn)登陸Ftp的方法,快看看學(xué)習(xí)一下吧。我們都知道遠(yuǎn)程視頻傳輸可以采用線程下載、圖片壓縮,還可以考慮先儲(chǔ)存進(jìn)數(shù)據(jù)庫(kù)中
VB.NET實(shí)用教程代碼:
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 ’這個(gè)函數(shù)表示服務(wù)器要求的圖片質(zhì)量 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) '這里對(duì)圖片進(jìn)行壓縮函數(shù) 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) '服務(wù)器的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
上述就是小編為大家分享的如何進(jìn)行VB.NET實(shí)現(xiàn)登陸Ftp的分析了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。