Hi,
I have an ASP file that updates a file, I need to keep the updating capabilty in a multi-access environment.
how can I modify my code (below) to allow multi-access (somthing similar to non blocking I/O in Java)?
Thanks,
Alonex
My code:
=========
<%
if (Request.Form("user_id"))<>"" then
'declare our variables
Dim passwd,objFSO , myFile, findStr,ReadLineTextFile,MyFileRead,pos
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set myFileRead = objFSO.OpenTextFile("c:\file.txt", 1)
findStr=Request.Form("user_id")
foundID = false
Do While MyFileRead.AtEndOfStream <> True
ReadLineTextFile = MyFileRead.ReadLine
pos=InStr(1,ReadLineTextFile,findSTR,1)
if (pos <> 0) Then foundID = True
' if (StrComp(finsSTR,ReadLineTextFile))=0 Then foundID = True
Loop
MyFileRead.close
if foundID = True Then
msg = (Request.Form("user_id"))&" is already regisered"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & msg & """<" & "/script>")
else
'create a text file called c:\file.txt , this was created on the C drive
Set myFile = objFSO.OpenTextFile("c:\file.txt", 8)
myFile.WriteLine(Request.Form("user_id"))
myFile.Close
Set myFile = Nothing
Set objFSO = Nothing
'response.write(Request.Form("user_id"))
msg = (Request.Form("user_id"))&" had been registered successfully"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & msg & """<" & "/script>")
'&(Request.Form("user_id"))&" had been registered"
Response.End
End if
End if
%>
I have an ASP file that updates a file, I need to keep the updating capabilty in a multi-access environment.
how can I modify my code (below) to allow multi-access (somthing similar to non blocking I/O in Java)?
Thanks,
Alonex
My code:
=========
<%
if (Request.Form("user_id"))<>"" then
'declare our variables
Dim passwd,objFSO , myFile, findStr,ReadLineTextFile,MyFileRead,pos
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set myFileRead = objFSO.OpenTextFile("c:\file.txt", 1)
findStr=Request.Form("user_id")
foundID = false
Do While MyFileRead.AtEndOfStream <> True
ReadLineTextFile = MyFileRead.ReadLine
pos=InStr(1,ReadLineTextFile,findSTR,1)
if (pos <> 0) Then foundID = True
' if (StrComp(finsSTR,ReadLineTextFile))=0 Then foundID = True
Loop
MyFileRead.close
if foundID = True Then
msg = (Request.Form("user_id"))&" is already regisered"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & msg & """<" & "/script>")
else
'create a text file called c:\file.txt , this was created on the C drive
Set myFile = objFSO.OpenTextFile("c:\file.txt", 8)
myFile.WriteLine(Request.Form("user_id"))
myFile.Close
Set myFile = Nothing
Set objFSO = Nothing
'response.write(Request.Form("user_id"))
msg = (Request.Form("user_id"))&" had been registered successfully"
Response.Write("<" & "script language=VBScript>")
Response.Write("MsgBox """ & msg & """<" & "/script>")
'&(Request.Form("user_id"))&" had been registered"
Response.End
End if
End if
%>