|
-
Mar 17th, 2004, 11:24 AM
#1
Thread Starter
Addicted Member
File system object verse System.IO namespace
In my ASP application I created a function that created a unique password that was automatically generated for the customer. Here was my code:
Public Function GetNewPassword() As String
Dim fs
Dim intPos
Dim strChar
Dim strPassword
fs = CreateObject("Scripting.FileSystemObject")
strPassword = fs.GetBaseName(fs.GetTempName)
strPassword = Right(strPassword, Len(strPassword) - 3)
intPos = Weekday(Now())
If intPos <> 5 Then
intPos = intPos Mod 5
End If
strChar = Mid(strPassword, intPos, 1)
If IsNumeric(strPassword) Then
strChar = int(strChar)
strPassword = Chr(65 + strChar) & strPassword & Chr(90 - strChar)
Else
strPassword = strPassword & Asc(strChar)
End If
fs = Nothing
GetNewPassword = strPassword
End Function
I know that I can't use the FileSystem object in ASP.Net, but cannot find an equivelent to "GetBaseName" and "GetTempName" in the System.IO. Does anyone have a suggestion as to how I can create a unique password at runtime? Or what namespace I should be using for GetBaseName?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|