Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parsing string for values

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
I have an asp file that I need to extract all the names of controls/fields on the form. i.e. name="address1" I need the address1 pulled out and put in a text file.

Thanks for the help..Russ
 
Use the Request object to get the value, after you submit the page. Then if you want to do a text file on the client side, I don't think you can. But to create a text file on the server, using VB 6, open a new ActiveX DLL. Then name the project WriteFile and the class module Writer. (You can change the names as long as you do so consistently through this example. Inside the class module, add this code:

Code:
Public Sub Write(byval sTextToWrite as String)
    Open "C:\MyText.txt" For Output as #1
    Print #1, sTextToWrite
    Close #1
End Sub

Save it, and select Make executable from the file menu. copy the WriteFile.dll to the server, and register it by going to Start|Run and typing "Regsvr32 (pathtodll)\WriteFile.dll"

Then add this code to your ASP page:

Dim X
Set X = Server.CreateObject("WriteFile.Writer")
X.Write Request("name") ' or other form name
Set X = Nothing

That's the only way I know to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top