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.
以下行给出错误(无法将类型“string”转换为“System.Guid”)
userId = Request.QueryString["id"];
有什么解决方案可以在 http 标头 Get 中传递 Guid 变量吗?
try { userId = new Guid(Request.QueryString["id"]); } catch (FormatException e) { /* * It's possible that the guid is not properly formatted and an * exception will be thrown, so handle that here. */ }