扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:佚名 来源:Microsoft 2007年10月24日
关键字:
Dim i As Integer Dim output As String = "" Dim aCookie As HttpCookie For i = 0 to Request.Cookies.Count - 1 aCookie = Request.Cookies(i) output &= "Cookie 名称 = " & Server.HtmlEncode(aCookie.Name) & "<br>" output &= "Cookie 值 = " & Server.HtmlEncode(aCookie.Value) & _ & "<br><br>" Next Label1.Text = output |
Dim i As Integer Dim j As Integer Dim output As String = "" Dim aCookie As HttpCookie Dim subkeyName As String Dim subkeyValue As String For i = 0 To Request.Cookies.Count - 1 aCookie = Request.Cookies(i) output &= "名称 = " & aCookie.Name & "<br>" If aCookie.HasKeys Then For j = 0 To aCookie.Values.Count - 1 subkeyName = Server.HtmlEncode(aCookie.Values.AllKeys(j)) subkeyValue = Server.HtmlEncode(aCookie.Values(j)) output &= "子键名称 = " & subkeyName & "<br>" output &= "子键值 = " & subkeyValue & "<br><br>" Next Else output &= "值 = " & Server.HtmlEncode(aCookie.Value) & "<br><br>" End If Next Label1.Text = output |
If aCookie.HasKeys Then Dim CookieValues As _ System.Collections.Specialized.NameValueCollection = aCookie.Values Dim CookieValueNames() As String = CookieValues.AllKeys For j = 0 To CookieValues.Count – 1 subkeyName = Server.HtmlEncode(CookieValueNames(j)) subkeyValue = Server.HtmlEncode(CookieValues(j)) output &= "子键名称 = " & subkeyName & "<br>" output &= "子键值 = " & subkeyValue & "<br><br>" Next Else output &= "值 = " & aCookie.Value & "<br><br>" End If |
Dim counter As Integer If Request.Cookies("counter") Is Nothing Then counter = 0 Else counter = CInt(Request.Cookies("counter").Value) End If counter += 1 Response.Cookies("counter").Value = counter.ToString Response.Cookies("counter").Expires = DateTime.Now.AddDays(1) |
Dim ctrCookie As HttpCookie Dim counter As Integer If Request.Cookies("counter") Is Nothing Then ctrCookie = New HttpCookie("counter") Else ctrCookie = Request.Cookies("counter") End If counter = CInt(ctrCookie.Value) + 1 ctrCookie.Value = counter.ToString ctrCookie.Expires = DateTime.Now.AddDays(1) Response.Cookies.Add(ctrCookie) |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者