Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to auto login to Terminal Services?
Message
De
06/05/2003 19:57:53
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00785629
Message ID:
00785641
Vues:
18
Hi Mike,

I haven't worked with the PocketPC but the following code automates Windows 2000 Terminal Server from VFP. You still need to enter the password in Terminal Server though.
LPARAMETERS pcServerName, pcUserName, pcDomain

LOCAL cURL, oIE

oIE = CREATEOBJECT("InternetExplorer.Application")

cURL = "http://" + pcServerName + "/"

oIE.Navigate(cURL)

INKEY(1)

nStartSeconds = SECONDS()

DO WHILE oIE.ReadyState # 4 ;
   AND SECONDS() - nStartSeconds < 10
ENDDO

IF oIE.ReadyState # 4
    MESSAGEBOX("Can't connect to " ;
             + cURL ;
             + "." ;
             , 48 ;
             , "Terminal Server Error")
    oIE = .Null.
    RELEASE oIE
    RETURN .F.
ENDIF

IF TYPE("oIE.Document.Body.All.Server.Value") = "U" ;
OR TYPE("oIE.Document.Body.All.CheckBoxAutoLogon.Value") = "U" ;
OR TYPE("oIE.Document.Body.All.UserName.Value") = "U" ;
OR TYPE("oIE.Document.Body.All.Domain.Value") = "U" ;
OR TYPE("oIE.Document.Body.All.ButtonLogin.Value") = "U"
    MESSAGEBOX(cURL ;
             + " doesn't appear to be a Terminal Server." ;
             , 48 ;
             , "Terminal Server Error")
    oIE = .Null.
    RELEASE oIE
    RETURN .F.
ENDIF

WITH oIE.Document.Body.All
    .Server.Value = pcServerName
    .CheckBoxAutoLogon.Click()
    .CheckBoxAutoLogon.Checked = .T.
    .UserName.Value = pcUserName
    .Domain.Value = pcDomain
    .ButtonLogin.Click()
ENDWITH

oIE.Visible = .T.

oIE = .Null.

RELEASE oIE
Hope this helps,
Gavin.

>I have a VFP app on the server designed for PocketPC. I’m using terminal services to connect and run the app. Does anyone know how to automatically login to terminal services using a PocketPC OS. The regular terminal services login is very cumbersome using the PocketPC stylus.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform