当前位置:编程学习 > C#/ASP.NET >>

网站最后关闭的浏览器

用户在浏览本站时,无论登录与否,判断在出用户关闭的浏览器是本站最后一页???请高人指点 --------------------编程问答-------------------- 没有登录页可以进入本站的最后一页? --------------------编程问答-------------------- 判断URL啊…… --------------------编程问答-------------------- 在最后一页弄个判断用户登录的设置?如果没登录直接关闭了? --------------------编程问答-------------------- 再别的地方找的,关闭时出发这个事件,试一试
通过FindWindow获取IE,取值
 [DllImport("User32.dll")]  
  static extern int FindWindow(string lpClassName, string lpWindowName);
  [DllImport("User32.dll")]
  static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow);
  [DllImport("User32.dll")]
  static extern int GetWindowText(int hwnd, StringBuilder buf, int nMaxCount);
  [DllImport("User32.dll")]
  static extern int SendMessage(int hWnd, int Msg, int wParam, StringBuilder lParam);
  const int WM_GETTEXT = 0x000D;  
  public static string GetURL()  
  {
  int parent = FindWindow("IEFrame", null);
  int child = FindWindowEx(parent, 0, "WorkerW", null);
  child = FindWindowEx(child, 0, "ReBarWindow32", null);
  child = FindWindowEx(child, 0, "ComboBoxEx32", null);
  child = FindWindowEx(child, 0, "ComboBox", null);
  child = FindWindowEx(child, 0, "Edit", null);   
  StringBuilder buffer = new StringBuilder(1024);
  int num = SendMessage(child, WM_GETTEXT, 1024, buffer);
  string URL = buffer.ToString();
  return URL;
  }
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,