Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用以下有什么区别
Request.Cookies["Key"].Value
和
Request.Cookies["Key"].ToString()
是的,运行以下代码块演示了不同的输出:
Request.Cookies.Add(new HttpCookie("Test", "MyValue")); Debug.Print(Request.Cookies["Test"].Value); Debug.Print(Request.Cookies["Test"].ToString());
第一个调试打印将显示“MyValue”,而第二个将显示“System.Web.HttpCookie”。