星空网 > 软件开发 > ASP.net

Guid的使用

今天在公司做修改功能时,老大让使用部分更新,但是表中的主键是UNIQUEIDENTIFIER类型,它会在我们添加纪录时,默认生成一个unicode码,

但是我现在必须要将获取到的已经是string类型的unicode码,反过来给其中的一个表类型变量赋值。于是百度,后来发现居然是这样的,只需要用这个

unicode码的string形式初始化一个unicode即可。

代码如下:

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Guid的学习使用{  class Program  {    static void Main(string[] args)    {      string s = Guid.NewGuid().ToString();      Console.WriteLine(s);      Guid myGuid = new Guid(s);      Console.WriteLine(myGuid.ToString());      Console.ReadKey();    }  }}

输出结果:

Guid的使用




原标题:Guid的使用

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

到美国的跨境电商物流:https://www.goluckyvip.com/tag/93135.html
跨境电商物流的功能有:https://www.goluckyvip.com/tag/93136.html
跨境台湾物流:https://www.goluckyvip.com/tag/93137.html
澳大利亚跨境电商物流:https://www.goluckyvip.com/tag/93138.html
跨境电商物流对比:https://www.goluckyvip.com/tag/93139.html
韩国跨境电商物流:https://www.goluckyvip.com/tag/93140.html
怎样做出一个有利可图的SaaS产品?:https://www.kjdsnews.com/a/1836639.html
【再放信号】美国Etsy即将放开中国卖家入驻,官方邮件你收到了吗?:https://www.kjdsnews.com/a/1836640.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流