Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everybody,
I am new to asp.net.I got a task to retrieve a data from textbox and i should store that as text-file....don't know how to do that......
kindly send me a code for that its urgent
Posted
Updated 24-Nov-10 23:48pm
v2
Comments
TweakBird 26-Nov-10 6:50am    
don't post same question repeatedly.

You do it the same way you do it for any other .net platform. Retrieve the text from the control, and write a text file to the hard drive.

Are you actually working as a programmer, or were you just handed this "task" because you can spell the word "computer"?
 
Share this answer
 
Try this,
VB
Imports System.IO
Imports System.Diagnostics

Public Sub writeToFile(ByVal strMsg As String)
        Dim strLogPath As String = ""
        Dim fs As FileStream
        Dim sw As StreamWriter
        
        strLogPath = filepath 'here give ur file path
        If File.Exists(strLogPath) = True Then
            fs = File.Open(strLogPath, FileMode.Append, FileAccess.Write)
            sw = New StreamWriter(fs)
        Else
            fs = File.Create(strLogPath)
            sw = New StreamWriter(fs)
        End If
        sw.WriteLine(strMsg)

        sw.Close()
        fs.Close()
    End Sub
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900