当前位置:编程学习 > C#/ASP.NET >>

怎么将一个string类型的变量转换成guid

怎么将一个string类型的变量转换成guid --------------------编程问答-------------------- 直接构造就可以吧

Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4") --------------------编程问答-------------------- 看看下面的页
http://topic.csdn.net/t/20050621/16/4096995.html

http://topic.csdn.net/t/20050727/01/4170175.html --------------------编程问答-------------------- try

string test = "27c26d46-8c17-4e7c-8888-f8fcd4169405";
Guid result = new Guid(test); --------------------编程问答-------------------- 楼上正解 --------------------编程问答-------------------- 谢了 --------------------编程问答-------------------- string test = "27c26d46-8c17-4e7c-8888-f8fcd4169405";
Guid result = new Guid(test); --------------------编程问答-------------------- 只有三楼说的这种呀。没得更简洁的了呀。。。。 --------------------编程问答--------------------     /// <summary>
        /// 
        /// </summary>
        public Guid? UserID
        {      
            get { return this._UserID; }
            set {  this._UserID =value; }
        }
但是value 下面有红线,显示错误,求正解
--------------------编程问答--------------------
引用 3 楼 lxcnn 的回复:
try

string   test   =    "27c26d46-8c17-4e7c-8888-f8fcd4169405 ";
Guid   result   =   new   Guid(test);


very right!!! --------------------编程问答-------------------- [img=http://hi.csdn.net/weizhuangzhi][/img]
高! --------------------编程问答-------------------- 试试了。

不知出不出来。 --------------------编程问答-------------------- 哈哈,出来了。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,