是否有任何函数来生成UNIQUE字符串或UNIQUE编号?

时间:2023-01-09 04:19:40

I need for function to generate a UNIQUE string, like:

我需要函数来生成一个UNIQUE字符串,如:

DIM uniStr as string = generateUniStr()

DIM uniStr as string = generateUniStr()

is there any function already do this ?

有没有任何功能已经这样做了?

2 个解决方案

#1


You can use

您可以使用

Dim uniStr = Guid.NewGuid().ToString()

#2


You can gen up a GUID and stringify it.

您可以生成GUID并对其进行字符串化。

You might want to give more details on what you're really looking for, because it's likely there's a better solution.

您可能想要提供有关您真正需要的内容的更多详细信息,因为这可能是一个更好的解决方案。

#1


You can use

您可以使用

Dim uniStr = Guid.NewGuid().ToString()

#2


You can gen up a GUID and stringify it.

您可以生成GUID并对其进行字符串化。

You might want to give more details on what you're really looking for, because it's likely there's a better solution.

您可能想要提供有关您真正需要的内容的更多详细信息,因为这可能是一个更好的解决方案。