C# 如何获得;Guid";ASP.NET中http头中的变量
下一行给出错误(无法将类型“string”转换为“System.Guid”) 是否有任何解决方案可以在http标头Get中传递Guid变量C# 如何获得;Guid";ASP.NET中http头中的变量,c#,asp.net,http,header,guid,C#,Asp.net,Http,Header,Guid,下一行给出错误(无法将类型“string”转换为“System.Guid”) 是否有任何解决方案可以在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 wi
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.
*/
}
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.
*/
}