|
-
Sep 5th, 2004, 10:28 AM
#1
Thread Starter
Junior Member
send form results to csv
I have created a basic web form (with text boxes, option buttons etc) and need to send this information to a csv on the server.
eg i have a text box on the web page called
txtname, txttitle, txtphone
and need them to appear in the csv as:
francis, mr, 55517272
any thoughts?
thanks
Francis
-
Sep 5th, 2004, 10:41 AM
#2
Frenzied Member
Magiaus
If I helped give me some points.
-
Sep 5th, 2004, 11:52 AM
#3
Thread Starter
Junior Member
comma seperated file - text file
-
Sep 5th, 2004, 11:53 AM
#4
Frenzied Member
Just write to a file then. The folder has to have write permissions and use System.IO.File......... it pretty simple.
Magiaus
If I helped give me some points.
-
Sep 7th, 2004, 04:39 AM
#5
Thread Starter
Junior Member
That is my question:
How do I write to a file?
I have textboxes on the form which need to be written to the file.
Thanks
Francis
-
Sep 7th, 2004, 09:42 AM
#6
Frenzied Member
System.IO.File.Open/Create
Returns a stream then you use the stream to write to the file.
Code:
System.IO.Stream stream = System.IO.File.Open(path, System.IO.FileMode.Create, System.IO.FileAccess.Write);
System.IO.Stream stream_b = System.IO.File.Open(path_b, System.IO.FileMode.Create, System.IO.FileAccess.Write);
for(int i = 0; i < upFile.PostedFile.InputStream.Length; i++) //loop through the file from the servers cache
{
stream.WriteByte((byte)upFile.PostedFile.InputStream.ReadByte());
}
byte[] b;
b = System.Text.Encoding.ASCII.GetBytes(txtFileInfo.Text);
stream_b.Write(b, 0, b.Length);
stream.Close();
stream_b.Close();
Magiaus
If I helped give me some points.
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
|