•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,607 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,481 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1251 | Replies: 3
![]() |
•
•
Join Date: Sep 2007
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I remember reading something in the past aboout storing form values into strings, then the strings into a .txt document, but that was all about VB 6.0. Could someone give me some source, and even better, an explanation as to how I can make it so the user clicks 'Submit', and their email address (from a input box with name="email" id="email") is stored in a .txt document.
•
•
Join Date: Sep 2007
Posts: 1,058
Reputation:
Rep Power: 4
Solved Threads: 61
<%@ Import Namespace="System.IO" %>
<script language="vb" runat="server">
sub Page_Load(sender as Object, e as EventArgs)
'This will create the file if it doesn't exist, and will also
'continue to add text to the file. To overwrite the file,
'just remove the true attribute.
Dim objStreamWriter As New StreamWriter(FileName, true)
objStreamWriter.WriteLine(Request.Form("email") & ";" & vbCrLf)
objStreamWriter.Close()
''Now to read the text file and display contents:
'Get a StreamReader class that can be used to read the file
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(FileName)
'Now, read the entire file into a string
Dim contents as String = objStreamReader.ReadToEnd()
'We may wish to replace carraige returns with <br>s
lblNicerOutput.Text = contents.Replace(vbCrLf, "<br>")
objStreamReader.Close()
end sub
</script> Last edited by SheSaidImaPregy : Nov 10th, 2007 at 12:11 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp breach broadband code combo crime custom daniweb data data protection data transfer database developer development dom drive dropdownlist feed forensics government hard hardware hitachi internet linux microsoft module msdn net news office reader reuse security skin software sql storage terabyte theme vista weather web wikipedia xml xoap
- CDOSYS Form to Email Formatting (ASP)
- results to form field (PHP)
- a blank form to insert data???? (Visual Basic 4 / 5 / 6)
- Can I have a form without having an associated file. (JavaScript / DHTML / AJAX)
- how can i display the ms word document in asp page? (ASP)
- showing the form after insertind data (PHP)
- Help with asp form will not display contact information (ASP)
- simple cgi script issue (Python)
- Reading MSWord Document through an ASP Statement (ASP)
Other Threads in the ASP.NET Forum
- Previous Thread: Problem with Paging in Report Viewer
- Next Thread: NEED HELP! I want to learn ASP.NET



. I've been really busy with my .net work for my course. Thanks for the assistance, this will really help me, as I've not yet been able to read this section of my ebook. I'll add to your reputation again,
.
Linear Mode