数字问题! [英] Numbers Question!

查看:52
本文介绍了数字问题!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了

创建GUID之外,请求获取唯一数字的最佳方法是什么?现在这就是我在做什么,但我不是很开心

用它。

随机rnd = new Random((int)System.DateTime.Now.Ticks) ;

int unique = rnd.Next();


TIA


-

========

问候

Vai

========

what''s the best way of getting unique numbers when requested other than
creating GUIDs? Right now this is what I am doing but I am not very happy
with it.
Random rnd=new Random((int)System.DateTime.Now.Ticks);
int unique=rnd.Next();

TIA

--
========
Regards
Vai
========

推荐答案

您好Vai


这些数字是什么?它们是否用于数据库中的记录?什么是Guid的b $ b错误?


加里


" Vai2000" < va*@onebox.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Hi Vai

What are these numbers for? Are they for records in a database? What is
wrong with a Guid?

Gary

"Vai2000" <va*@onebox.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
what'除了创建GUID之外的其他请求,获取唯一数字的最佳方法是什么?现在这就是我正在做的事情,但我对它不太满意。

随机rnd = new Random((int)System.DateTime.Now.Ticks);
int unique = rnd.Next();

TIA

-
========
问候
Vai
========
what''s the best way of getting unique numbers when requested other than
creating GUIDs? Right now this is what I am doing but I am not very happy
with it.
Random rnd=new Random((int)System.DateTime.Now.Ticks);
int unique=rnd.Next();

TIA

--
========
Regards
Vai
========





" Vai2000" < va*@onebox.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

"Vai2000" <va*@onebox.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
what'除了创建GUID之外的其他请求,获取唯一数字的最佳方法是什么?现在这就是我正在做的事情,但我对它不太满意。

随机rnd = new Random((int)System.DateTime.Now.Ticks);
int unique = rnd.Next();

TIA

-
========
问候
Vai
========
what''s the best way of getting unique numbers when requested other than
creating GUIDs? Right now this is what I am doing but I am not very happy
with it.
Random rnd=new Random((int)System.DateTime.Now.Ticks);
int unique=rnd.Next();

TIA

--
========
Regards
Vai
========







随机数不是唯一的!这是不可预测的(那是'随机的'

意味着:-))但是可以获得重复的值。


Hans Kesting



Hi,

A random number is NOT unique! It is unpredictable (that''s what "random"
means :-) ) but it is possible to get duplicate values.

Hans Kesting


不幸的是我需要这个值来创建唯一的数字ID(它的部分

的命名约定) - 我没有权限访问数据库!!


谢谢

" Gary van der Merwe" < GA ***** @ hotmail.com>在消息中写道

news:ub ************** @ TK2MSFTNGP12.phx.gbl ...
Unfortunately I need this value for creating unique numerical ID (Its part
of a naming convention) - I don''t have access to DB!!

Thanks
"Gary van der Merwe" <ga*****@hotmail.com> wrote in message
news:ub**************@TK2MSFTNGP12.phx.gbl...
Hi Vai
这些数字是为了什么?它们是否用于数据库中的记录?什么是Guid的错误?

Gary

" Vai2000" < va*@onebox.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
Hi Vai

What are these numbers for? Are they for records in a database? What is
wrong with a Guid?

Gary

"Vai2000" <va*@onebox.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
什么是最好的除了创建GUID之外的其他请求获取唯一数字的方法?现在这就是我正在做的事情,但我对它不是很满意。

随机rnd = new Random((int)System.DateTime.Now.Ticks);
int unique = rnd.Next();

TIA

-
========
问候
Vai
========
what''s the best way of getting unique numbers when requested other than
creating GUIDs? Right now this is what I am doing but I am not very happy with it.
Random rnd=new Random((int)System.DateTime.Now.Ticks);
int unique=rnd.Next();

TIA

--
========
Regards
Vai
========




这篇关于数字问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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