如何使用C#在Encript Formate中生成随机Id键 [英] How Can I Generate A Random Id Key In Encript Formate Using C#

查看:138
本文介绍了如何使用C#在Encript Formate中生成随机Id键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在数据插入数据库时​​创建自动生成的密钥,并为该数据插入生成的密钥



例如:如果我输入任何数据到数据库通过文本框

在后台一个编写的密钥将生成数据库中的数据

如果我输入另一个数据到数据库一个更多的密钥将生成并保存到该数据



数据库:

I have a requriment to create autogenerated key when data is inserted to database and also insert that generated key for that data

Ex: If i enter any data to database through Textbox
in background a encriped key will generat for that data in databse
if i enter another data to database one more key will generat and save to that data

DataBase:

Column1    | Column2     | Column3
Topic(1)   |TpoicInfo(1) | AutoKeyGenereted(1)
Topic (2)  |TpoicInfo(2) | AutoKeyGenereted1(2)







示例




Example

Topics   | TpoicInfos | AutoKeyGenereteds
Picnic   | Good       | 456789523565fdf
Movie    | Bad        | 9652332fdfdf222



就像我想要


like that i want

推荐答案

你可以使用
Guid.NewGuid().ToString()

另见:随机是System.Guid.NewGuid()? [ ^ ]


这篇关于如何使用C#在Encript Formate中生成随机Id键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆