顺序指导 [英] Sequencial Guid

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

问题描述

在C#中是否有一个等效的类函数来生成顺序guid,就像SQL Server 2005中的NewSequentialID()函数一样?b / b

Is there an equivalent class function in C# to generate sequencial guid just
like the NewSequentialID() function in SQL Server 2005?

推荐答案

Roy,

由于每个Guid的定义都是完全独特的,因此可能永远不会像顺序指南那样。如果您需要

唯一的标识符,则应考虑使用其他方法。一个带有初始值的静态双b / b $ b和一个简单递增这个的方法就可以了。

可以做到这一点。如果它需要是一个字符串,你可以使用ToString()

方法。

Peter

Roy,
Since each Guid by definition is completely unique, there could never
be such as thing as a "Sequential Guid". If you need identifiers that
are unique, you should consider using another method. A static double
with an initial value and a method that simply increments this would
do the trick. If it needs to be a string, you can take the ToString()
method on it.
Peter


Roy,


您可以通过P / Invoke

图层使用UuidCreateSequential API函数。


欲了解更多信息,请查看pinvoke.net上的条目:

http://www.pinvoke.net/default.aspx/...equential.html


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


Roy < Ro *@discussions.microsoft.com写信息

新闻:80 *************************** ******* @ microsof t.com ...
Roy,

You can use the UuidCreateSequential API function through the P/Invoke
layer.

For more info, check out the entry on pinvoke.net:

http://www.pinvoke.net/default.aspx/...equential.html

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Roy" <Ro*@discussions.microsoft.comwrote in message
news:80**********************************@microsof t.com...

在C#中是否有一个等效的类函数来生成顺序guid

只是

喜欢SQL Server 2005中的NewSequentialID()函数?
Is there an equivalent class function in C# to generate sequencial guid
just
like the NewSequentialID() function in SQL Server 2005?



Hello Nicholas Paldino [.NET / C#MVP],


hmm,awesome

但是为什么MS要求guids顺序?有什么实际的理由

这个吗?


NRoy,

N>

NYou can通过

NP / Invoke层使用UuidCreateSequential API函数。

N>

N更多信息,请查看pinvoke.net上的条目:

N>

N http://www.pinvoke.net/default.aspx/...equential.html

N>

NHope this帮助。

N>

N" Roy" < Ro *@discussions.microsoft.com写信息

新闻:80 *************************** ******* @ microso ft.com ...

N>
Hello Nicholas Paldino [.NET/C# MVP],

hmm, awesome
But why MS desided make guids sequential? Are there any practical reasons
for this?

NRoy,
N>
NYou can use the UuidCreateSequential API function through the
NP/Invoke layer.
N>
NFor more info, check out the entry on pinvoke.net:
N>
Nhttp://www.pinvoke.net/default.aspx/...equential.html
N>
NHope this helps.
N>
N"Roy" <Ro*@discussions.microsoft.comwrote in message
Nnews:80**********************************@microso ft.com...
N>

> C#中是否有等效的类函数来生成序列
guid
只是
喜欢SQL Server 2005中的NewSequentialID()函数?
>Is there an equivalent class function in C# to generate sequencial
guid
just
like the NewSequentialID() function in SQL Server 2005?



---

WBR,

Michael Nemtsev :: blog: http://spaces.live.com/laflour


有时一个人仍然忠于一个事业,只因为它的对手没有,b $ b不再是平淡无奇的。 (c)Friedrich Nietzsche

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


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

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