Visual Basic Code |
Private Sub Command1_Click ( ) MsgBox GetCodeing End Sub Private Function GetCodeing ( ) As String '取得保存的信息 Dim SDate As String Dim SNumeric As String Dim ReturnStr As String SDate = GetSetting ( appname: = "MyApp", section: = "GetCodeing", Key: = "SDate", Default: = CStr ( Date ) ) SNumeric = GetSetting ( appname: = "MyApp", section: = "GetCodeing", Key: = "SNumeric", Default: = "0" ) If CDate ( SDate ) < Date Then SDate = Date: SNumeric = 0 SNumeric = CLng ( SNumeric ) + 1 ReturnStr = Format ( SDate, "yyMMdd" ) & Format ( SNumeric, "00" ) SaveSetting "MyApp", "GetCodeing", "SDate", SDate SaveSetting "MyApp", "GetCodeing", "SNumeric", SNumeric GetCodeing = ReturnStr End Function |
简单的实现多进程同时使用一种编号,而每个编号都是唯一的
最新推荐文章于 2024-03-29 09:27:12 发布