很早前在做本站V2時(shí)用到的一些代碼,也比較實(shí)用,現(xiàn)在貢獻(xiàn)出來,希望對(duì)大家有用
Flash與html 的一些實(shí)用技巧
狀態(tài)欄的文字顯示,可以用來在做E文字按鈕的時(shí)候方便不懂E文的人理解
設(shè)為首頁(一般關(guān)閉窗口,加入收藏都比較簡單,這個(gè)稍微需要點(diǎn)技巧)
Flash中直接調(diào)用sethomepage()函數(shù)即可
一段ASP代碼,取得訪問者的IP地址,操作系統(tǒng),瀏覽器(版本類型不是很全,大家可以再嘗試補(bǔ)充一下)
這是SWF文件在讀取的時(shí)候變量引用
Flash與html 的一些實(shí)用技巧
狀態(tài)欄的文字顯示,可以用來在做E文字按鈕的時(shí)候方便不懂E文的人理解
設(shè)為首頁(一般關(guān)閉窗口,加入收藏都比較簡單,這個(gè)稍微需要點(diǎn)技巧)
Flash中直接調(diào)用sethomepage()函數(shù)即可
一段ASP代碼,取得訪問者的IP地址,操作系統(tǒng),瀏覽器(版本類型不是很全,大家可以再嘗試補(bǔ)充一下)
<%
function GetBorwser()
dim BcType,Browser,System,Ver,strSystem,strBrowser
str = Request.ServerVariables("HTTP_USER_AGENT")
Agent = split(str,";")
Browser = "Unknown"
System = "Unknown"
BcType = 0
if InStr(Agent(1),"U")>0 and not(InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0) then
Ver = mid(Agent(0),InStr(Agent(0), "/")+1)
Ver = mid(Ver,1,InStr(Ver,"[")-1)
Browser = "Netscape " + Ver
System = mid(Agent(0),InStr(Agent(0), "(")+1)
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0then
if InStr(str,"Netscape6")>0 then
Ver = mid(Agent(4),InStr(Agent(4),"Netscape6")+10)
else
Ver = mid(Agent(4),InStr(Agent(4),"Netscape")+9)
end if
Browser = "Netscape " & Ver
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 then
Browser = Agent(1)
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 and InStr(str,"Opera") >0 then
Browser = mid(Agent(2), InStr(Agent(2),")")+2, InStr(Agent(2),"Opera")-4)
System = mid(Agent(2),1,InStr(Agent(2),")"))
System = replace(System, ")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
strSystem = System
if InStr(strSystem, "98") >0 and InStr(str,"Win 9x") >0 then
strSystem = replace(strSystem, "98", "Me")
end if
strSystem = replace(strSystem, "9x 4.90", "Me")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.1", "XP")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.2","2003")
strBrowser = replace(Browser, "MSIE", "Internet Explorer")
GetBorwser = strSystem&"+"&strBrowser&"+"&Request.ServerVariables("REMOTE_ADDR")
end function
dim bor,borwsys
bor = GetBorwser()
borwsys = split(bor,"+")
%>
//系統(tǒng)版本,瀏覽器,IP地址function GetBorwser()
dim BcType,Browser,System,Ver,strSystem,strBrowser
str = Request.ServerVariables("HTTP_USER_AGENT")
Agent = split(str,";")
Browser = "Unknown"
System = "Unknown"
BcType = 0
if InStr(Agent(1),"U")>0 and not(InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0) then
Ver = mid(Agent(0),InStr(Agent(0), "/")+1)
Ver = mid(Ver,1,InStr(Ver,"[")-1)
Browser = "Netscape " + Ver
System = mid(Agent(0),InStr(Agent(0), "(")+1)
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(str, "Gecko")>0 and InStr(str, "Netscape")>0then
if InStr(str,"Netscape6")>0 then
Ver = mid(Agent(4),InStr(Agent(4),"Netscape6")+10)
else
Ver = mid(Agent(4),InStr(Agent(4),"Netscape")+9)
end if
Browser = "Netscape " & Ver
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 then
Browser = Agent(1)
System = replace(Agent(2),")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
if InStr(Agent(1),"IE") >0 and InStr(str,"Opera") >0 then
Browser = mid(Agent(2), InStr(Agent(2),")")+2, InStr(Agent(2),"Opera")-4)
System = mid(Agent(2),1,InStr(Agent(2),")"))
System = replace(System, ")", "")
if not(InStr(System,"Windows")>0) then
System = replace(System, "Win", "Windows ")
end if
end if
strSystem = System
if InStr(strSystem, "98") >0 and InStr(str,"Win 9x") >0 then
strSystem = replace(strSystem, "98", "Me")
end if
strSystem = replace(strSystem, "9x 4.90", "Me")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.1", "XP")
strSystem = replace(strSystem, "NT 5.0", "2000")
strSystem = replace(strSystem, "NT 5.2","2003")
strBrowser = replace(Browser, "MSIE", "Internet Explorer")
GetBorwser = strSystem&"+"&strBrowser&"+"&Request.ServerVariables("REMOTE_ADDR")
end function
dim bor,borwsys
bor = GetBorwser()
borwsys = split(bor,"+")
%>
這是SWF文件在讀取的時(shí)候變量引用
system=<%=borwsys(0)%>&explorer=<%=borwsys(1)%>&ip=<%=borwsys(2)%>