IIS如何分配SessionID的?

RandomLife 2003-08-23 02:00:01
它是如何判断请求是来自同一浏览器、还是同一台机器上的不同浏览器、还是不同机器上的不同浏览器?
asp能不用SessionID做到这一点吗?
...全文
87 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
RandomLife 2003-08-25
  • 打赏
  • 举报
回复
一楼的没说怎么区分是不是同一浏览器啊。
我最终的目的其实就是在不同的服务器上可以知道你是在不同的机器上进行访问,还是在同一台机器上用不同的浏览器访问,还是在同一台机器上用同一浏览器访问。

asp能做到这一点吗?
yaojiabinnet 2003-08-23
  • 打赏
  • 举报
回复
int loop1, loop2;
NameValueCollection coll;

// Load ServerVariable collection into NameValueCollection object.
coll=Request.ServerVariables;
// Get names of all keys into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Key: " + arr1[loop1] + "<br>");
String[] arr2=coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++) {
Response.Write("Value " + loop2 + ": " + arr2[loop2] + "<br>");
}
}
changechange 2003-08-23
  • 打赏
  • 举报
回复
这还不简单,判定它的来源网卡编号,来源ip,来源浏览器即可

asp中内置支持啊?

<%
dim userip,userip2
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
userip2 = Request.ServerVariables("REMOTE_ADDR")
if userip = "" then
response.write "您的真实IP 是:"&userip2&","
else
response.write "您的真实IP 是:"&userip&","
end if
response.write usersysinfo(Request.ServerVariables("HTTP_USER_AGENT"),2)&","&usersysinfo(Request.ServerVariables("HTTP_USER_AGENT"),1)
%>


win2k下面可以的。
<%
strIP = Request.ServerVariables("REMOTE_ADDR")


Set net = Server.CreateObject("wscript.network")
Set sh = Server.CreateObject("wscript.shell")
sh.run "%comspec% /c nbtstat -A " & strIP & " > c:\" & strIP & ".txt",0,true
Set sh = nothing
Set fso = createobject("scripting.filesystemobject")
Set ts = fso.opentextfile("c:\" & strIP & ".txt")
macaddress = null
Do While Not ts.AtEndOfStream
data = ucase(trim(ts.readline))
If instr(data,"MAC ADDRESS") Then
macaddress = trim(split(data,"=")(1))
Exit Do

%>

<%
response.write(request.servervariables("HTTP_REFERER"))
response.write("----------------------")
'以下可以获得更多的信息
for each ob in Request.ServerVariables
response.write "<br>"&ob&":"&Request.ServerVariables(ob)
next

%>

<script language="javascript">
document.write(document.referrer)
document.write(document.url)
</script>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧