Exemple #1
0
        public void RemoteLogon(string BoxId, string Language = "EN")
        {
            //string ntAccount = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
            //WebClient client = new WebClient();
            //client.Headers.Add("content-type", "application/xml");
            //client.Credentials = CredentialCache.DefaultCredentials;
            ////http://c0049289.itcs.hp.com:8018/api/Account/AccountInfoByName?usr=ASIAPACIFIC\yanzhou&box=LH7_Andy&PC=test
            ////http://c0049289.itcs.hp.com:8018/api/account/AccountInfoByName?name={0}&pc={1}
            //string api = string.Format("http://c0040597.itcs.hp.com:8018/api/Account/AccountInfoByName?usr={0}&box={1}&PC={2}", ntAccount, BoxId, Environment.MachineName);
            //string str = client.DownloadString(api);
            //XmlDocument xml = new XmlDocument();
            //xml.LoadXml(str);

            //XmlNamespaceManager xmlspace = new XmlNamespaceManager(xml.NameTable);
            //xmlspace.AddNamespace("act", "http://schemas.datacontract.org/2004/07/SAPAccountService");
            //XmlNode id = xml.SelectSingleNode("//act:Account/act:Id", xmlspace);
            //XmlNode userName = xml.SelectSingleNode("//act:Account/act:UserName", xmlspace);
            //XmlNode password = xml.SelectSingleNode("//act:Account/act:Password", xmlspace);
            //XmlNode Client = xml.SelectSingleNode("//act:Account/act:Client", xmlspace);
            //XmlNode Server = xml.SelectSingleNode("//act:Account/act:Server", xmlspace);


            var account = _client.AccountInfoByName(BoxId, Environment.MachineName);

            //SAPTestHelper.Current.SetSession();
            //SAPTestHelper.Current.GetElementById<GuiTextField>("wnd[0]/usr/txtRSYST-BNAME").Text = account.UserName;
            //SAPTestHelper.Current.GetElementById<GuiTextField>("wnd[0]/usr/pwdRSYST-BCODE").Text = account.Password;
            //SAPTestHelper.Current.GetElementById<GuiTextField>("wnd[0]/usr/txtRSYST-MANDT").Text = account.Client;
            //SAPTestHelper.Current.GetElementById<GuiTextField>("wnd[0]/usr/txtRSYST-LANGU").Text = Language;
            //GuiFrameWindow window = SAPTestHelper.Current.GetElementById<GuiFrameWindow>("wnd[0]");
            //window.SendVKey(0);
        }