Программирование в IIS


Пример 1.8


'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'CreateNewID

'creates a new ID for a new chair

'

'in: nothing

'out: returns string ID for Chair

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Private Function CreateNewID() As String

Const NOW_TIME_FORMAT = "yyyymmddhhmmss"

Dim sDateTime As String

'get a time data stamp

sDateTime = CStr(Format(Now, NOW_TIME_FORMAT))

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'Note: This algorithm has a huge flaw.

'It does not create unique IDs if more than

'one is requested in a given second.

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'return value

CreateNewID = sDateTime

End Function




Начало  Назад  Вперед



Книжный магазин