用户在浏览本站时,无论登录与否,判断在出用户关闭的浏览器是本站最后一页???请高人指点
解决方案 »
- Repeater ItemDataBound 事件无法触发
- asp.net中控件HyperLinkField的用法?
- 大家看一下这个静态类 FindControl 报错,顺便问一下,静态类引用路径有没有什么技巧
- web服务器控件和html服务器控件的效率问题
- 欢迎试用Snake.Net
- 一个超级奇怪的问题,麻烦大家帮我解决,急
- 一个javascript的图片转换问题!高分求解。。。。。!!!!!(在线)
- 工作流图形化问题?!!!!!!!!!1
- 在DataGrid中有两个字段联合为主键,怎么获得?
- 一个简单问题。
- conn.asp连接不上,高手指点一下
- 在运行B/S网站时报这样的错?在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的。
通过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;
}