W
whitethomas12@gmail.com
Guest
I have a question on how to use Terminal Service API. I can
successfully implement it in VbScript, but I am having a very hard
time doing it in .NET. The following is my code in VB.NET 2.0 (Visual
Studios 2005)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim Tsc As MSTSCLib.IMsRdpClient2
Tsc = New MSTSCLib.MsRdpClient2()
Tsc.DesktopWidth = 49.5
Tsc.DesktopHeight = 50.5
Tsc.Server = "MyServer"
Tsc.UserName = "twhite"
Tsc.AdvancedSettings2.ClearTextPassword = "1234567"
Tsc.Domain = "myDomain"
Tsc.AdvancedSettings2.RedirectDrives = True
Tsc.AdvancedSettings2.RedirectPrinters = True
Tsc.AdvancedSettings2.RedirectPorts = False
Tsc.AdvancedSettings2.RedirectSmartCards = False
Tsc.SecuredSettings2.StartProgram = _
"C:\Program Files\Microsoft office\OFFICE11\EXCEL.EXE"
Tsc.Connect()
End Sub
By theory this should work, but all I get is a blank screen. I tried
to see if there is a client tool that I have to put on the desktop by
going to add toolbox items, but even when I select the RDP client tool
in the COM tab nothing appears.
Can someone please tell me what I am doing wrong
Thank you for all of your hellp in advance
successfully implement it in VbScript, but I am having a very hard
time doing it in .NET. The following is my code in VB.NET 2.0 (Visual
Studios 2005)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim Tsc As MSTSCLib.IMsRdpClient2
Tsc = New MSTSCLib.MsRdpClient2()
Tsc.DesktopWidth = 49.5
Tsc.DesktopHeight = 50.5
Tsc.Server = "MyServer"
Tsc.UserName = "twhite"
Tsc.AdvancedSettings2.ClearTextPassword = "1234567"
Tsc.Domain = "myDomain"
Tsc.AdvancedSettings2.RedirectDrives = True
Tsc.AdvancedSettings2.RedirectPrinters = True
Tsc.AdvancedSettings2.RedirectPorts = False
Tsc.AdvancedSettings2.RedirectSmartCards = False
Tsc.SecuredSettings2.StartProgram = _
"C:\Program Files\Microsoft office\OFFICE11\EXCEL.EXE"
Tsc.Connect()
End Sub
By theory this should work, but all I get is a blank screen. I tried
to see if there is a client tool that I have to put on the desktop by
going to add toolbox items, but even when I select the RDP client tool
in the COM tab nothing appears.
Can someone please tell me what I am doing wrong
Thank you for all of your hellp in advance