zoukankan      html  css  js  c++  java
  • 客户端登录状态下打开对应网站也处于登陆状态

     引用:
    1:Microsoft.mshtml
    COM” 选项卡;
     双击“Microsoft HTML Object Library”
    2:SHDocVw 
    COM” 选项卡;
     双击“Microsoft Internet Controls”。
    3:using System.Diagnostics;
    4:
    public static void webshow(object url)
            {
                if (string.IsNullOrEmpty(frmRing.username) || string.IsNullOrEmpty(frmRing.pwd))
                {
                    string target = (string)url;
                    Process.Start(target);
                }
                else
                {
                    try
                    {                   
                        SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
                        ie.Visible = false;
                        string URL = string.Format("{0}/lng1.aspx?mobile={1}&pwd={2}", Config.WebUrl, frmRing.username, frmRing.pwd);
                        object nullArg = Missing.Value;
                        ie.Navigate(URL, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
                        while (true)
                        {
                            if (ie.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                            {                           
                                ie.Navigate((string)url, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
                                while (true)
                                {
                                    if (ie.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_INTERACTIVE)
                                    {
                                        ie.Visible = true;
                                        break;
                                    }
                                }                           
                                break;
                            }
                        }                   
                    }
                    catch
                    { }
                }
            }
  • 相关阅读:
    一只小爬虫(转)
    easyui +ASP.NET 前后台乱码解决方法
    轻松搞定 easyui datagrid 二次加载的问题(转)
    easyui combobox默认选中项
    VS2010新建Web网站与新建Web应用程序的区别 (转)
    关于html+ashx开发中几个问题的解决方法 (转)
    如何使用.net访问Access数据库 (转)
    ACCESS的System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误
    Ajax 中正常使用jquery-easyui (转)
    会动的文字Marquee应用(转)
  • 原文地址:https://www.cnblogs.com/94cool/p/1532865.html
Copyright © 2011-2022 走看看