Может ли кто-нибудь помочь мне выполнить этот код шаг за шагом, потому что я начинаю с vb.net....спасибо, если кто-нибудь поможет
Global object reference. Public m_msTsc As AxMSTSCLib.AxMsRdpClient6NotSafeForScripting = Nothing Private Sub startSession() _Connected = False ' Global var m_msTsc = New AxMSTSCLib.AxMsRdpClient6NotSafeForScripting With m_msTsc .Dock = DockStyle.Fill AddHandler .OnConnected, AddressOf m_msTsc_OnConnected AddHandler .OnDisconnected, AddressOf m_msTsc_OnDisconnected AddHandler .OnChannelReceivedData, AddressOf m_msTsc_OnDataReceived AddHandler .OnFatalError, AddressOf m_msTsc_OnFatalError AddHandler .OnLogonError, AddressOf m_msTsc_OnLogonError AddHandler .OnWarning, AddressOf m_msTsc_OnWarning End With Me.Controls.Add(m_msTsc) With Me .Opacity = 0 .Visible = False .WindowState = FormWindowState.Minimized .ShowInTaskbar = False .FormBorderStyle = Windows.Forms.FormBorderStyle.None .Width = Screen.PrimaryScreen.WorkingArea.Width .Height = Screen.PrimaryScreen.WorkingArea.Height End With TimerConnect.Enabled = True End Sub Private Sub TimerConnect_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerConnect.Tick Try TimerConnect.Enabled = False FormPleaseWait.Close() FormPleaseWait.Show() Application.DoEvents() Dim rdpPort As Integer = 3389 Dim remoteServer As String If gibUser.isInternal Then remoteServer = gibUser.serverInternal Else remoteServer = gibUser.server End If If remoteServer.Contains(":") Then Dim p() As String = remoteServer.Split(":") remoteServer = p(0) rdpPort = CInt(p(1)) End If With m_msTsc .Server = remoteServer .UserName = gibUser.userName If Not gibUser.userName.Contains("\") Then .Domain = gibUser.domain End If .RemoteProgram.RemoteProgramMode = True .AdvancedSettings7.RDPPort = rdpPort .AdvancedSettings7.PublicMode = False ' Para usar as credenciais que lhes passamos aqui .AdvancedSettings7.AuthenticationLevel = 0 .AdvancedSettings7.ClearTextPassword = gibUser.Password .AdvancedSettings7.EnableAutoReconnect = True .AdvancedSettings7.DisableRdpdr = 0 .AdvancedSettings7.RedirectClipboard = True .AdvancedSettings7.RedirectPrinters = True .AdvancedSettings7.RedirectDevices = False .AdvancedSettings7.RedirectDrives = False .AdvancedSettings7.RedirectPorts = False .AdvancedSettings7.RedirectPOSDevices = False .AdvancedSettings7.RedirectSmartCards = False .AdvancedSettings7.SmartSizing = False 'http: 'msdn.microsoft.com/en-us/library/aa381256(VS.85).aspx .ColorDepth = My.Settings.ColorDepth 'int value can be 8, 15, 16, 24 or 32 .SecuredSettings2.AudioRedirectionMode = 2 ' 0 redirect 1 play on server 2 disable .CreateVirtualChannels("CHANEL001,CHANEL002,CHANEL003,CHANEL004") .Connect() TimerConnectTimeout.Enabled = True End With Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical) Me.Close() End Try End Sub Private Sub m_msTsc_OnConnected(ByVal sender As Object, ByVal e As EventArgs) FormPleaseWait.Label1.Text = "Launching remote app..." _Connected = True launchRemoteApp() RDP_SESSION = True End Sub Public Sub launchRemoteApp() Dim workingDir As String = gibUser.remoteAppPath workingDir = workingDir.Substring(0, workingDir.LastIndexOf("\")) m_msTsc.RemoteProgram.ServerStartProgram(gibUser.remoteAppPath, "", workingDir, False, "", False) _mainForm.credentialsDelete() End Sub Private Sub m_msTsc_OnDataReceived(ByVal sender As Object, ByVal e As AxMSTSCLib.IMsTscAxEvents_OnChannelReceivedDataEvent) Dim data As String = cleanCString(e.data.ToString) Dim channel = e.chanName.ToString MsgBox("Virtual Channel " + e.chanName.ToString() + vbCrLf + data) End Sub Private Function cleanCString(ByVal cString As String) As String Dim s As New System.Text.StringBuilder For i As Integer = 0 To cString.Length If Asc(cString.Substring(i, 1)) = 0 Then Exit For End If s.Append(cString.Substring(i, 1)) Next Return s.ToString End Function
Что я уже пробовал:
пытался выполнить в vb.net но ничего не поделаешь ....
CHill60
Предложение для любых будущих вопросов, которые вы можете опубликовать ... не говорите "не могу сделать", объясните, что происходит или какие сообщения об ошибках вы получаете. Мы не можем видеть ваш экран, исследовать ваш жесткий диск или читать ваши мысли.