vb 清除cookies文件
求VB清除Cookies代码,只要能清除cookies就行了,其它的就没什么要求了,不过别告诉我调用Bat文件...
求VB清除Cookies代码,只要能清除cookies就行了,其它的就没什么要求了,不过别告诉我调用Bat文件
展开
1个回答
展开全部
vb 不知道 用javascript 做
刚好有以前写的一段^_^
//设定cookie值
function setCookie(name, value, domain) {
document.cookie = "[" + name + "]=" + escape(value) +";path=/"+ ((domain)?";domain="+domain:"") // + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) +";secure"
}//:$
//读取cookie值
function getCookie(Name) {
var search = "[" + Name + "]="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// set index of end of cookie value
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}//:$
//删除cookie值
function deleteCookie(name,path,domain){
if(getCookie(name)) document.cookie = "["+ name +"]="+ ((path)?";path="+path:"") + ((domain)?";domain="+domain:"") //+";expires=Thu,01-Jan-70 00:00:01 GMT"
}
刚好有以前写的一段^_^
//设定cookie值
function setCookie(name, value, domain) {
document.cookie = "[" + name + "]=" + escape(value) +";path=/"+ ((domain)?";domain="+domain:"") // + ((expire == null) ? "" : ("; expires=" + expire.toGMTString())) +";secure"
}//:$
//读取cookie值
function getCookie(Name) {
var search = "[" + Name + "]="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// set index of end of cookie value
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}//:$
//删除cookie值
function deleteCookie(name,path,domain){
if(getCookie(name)) document.cookie = "["+ name +"]="+ ((path)?";path="+path:"") + ((domain)?";domain="+domain:"") //+";expires=Thu,01-Jan-70 00:00:01 GMT"
}
参考资料: www.80hys.cn
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询