Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何获取每个IE实例的会话id?_Asp.net_Internet Explorer - Fatal编程技术网

Asp.net 如何获取每个IE实例的会话id?

Asp.net 如何获取每个IE实例的会话id?,asp.net,internet-explorer,Asp.net,Internet Explorer,当我打开两个IE实例时,每个IE实例都应该有单独的id,这在2.0框架中是不可能的,而在1.0版本中是可能的 如何为每个IE实例获取会话id?框架没有问题。IE6用于启动新会话,但在更高版本中,您可以在“文件”菜单中获得显式选项,以在新会话中打开新窗口 public static string TheSessionId() { HttpSessionState ss = HttpContext.Current.Session; HttpContext.Current.Sess

当我打开两个IE实例时,每个IE实例都应该有单独的id,这在2.0框架中是不可能的,而在1.0版本中是可能的


如何为每个IE实例获取会话id?

框架没有问题。IE6用于启动新会话,但在更高版本中,您可以在“文件”菜单中获得显式选项,以在新会话中打开新窗口

public static string TheSessionId() {
     HttpSessionState ss = HttpContext.Current.Session;
     HttpContext.Current.Session["test"] = "test";
     HttpContext.Current.Response.Write(ss.SessionID);
     return "ok";
}
尝试上面的小功能,看看您是否获得了两个不同的会话ID。如果是这样,您只需要使用第一行,就可以获得会话ID