Click here to Skip to main content
15,915,094 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Problem with designer in vs.net 2005 pro Pin
GoodID21-Jun-07 17:30
GoodID21-Jun-07 17:30 
GeneralRe: Problem with designer in vs.net 2005 pro Pin
Mekong River21-Jun-07 18:38
Mekong River21-Jun-07 18:38 
QuestionCan crystal report v11 integrate with vs 2005 standard? Pin
Mekong River18-Jun-07 23:58
Mekong River18-Jun-07 23:58 
Questionhow to read data from text file, extract and display in excel format? Pin
mrr218-Jun-07 22:51
mrr218-Jun-07 22:51 
AnswerRe: how to read data from text file, extract and display in excel format? Pin
Christian Graus19-Jun-07 0:23
protectorChristian Graus19-Jun-07 0:23 
QuestionCut and paste files and folders from clipboard Pin
FriendlySoluations18-Jun-07 21:52
FriendlySoluations18-Jun-07 21:52 
AnswerRe: Cut and paste files and folders from clipboard Pin
iprasad00718-Jun-07 21:56
iprasad00718-Jun-07 21:56 
QuestionCreate Text file as ANSI encoding Format Pin
Rupesh Kumar Swami18-Jun-07 21:01
Rupesh Kumar Swami18-Jun-07 21:01 
hi,
i create text file through following code
here argument FilePath contain full path of file and Data contains Contents which has been written to text file. if file already exist then it add data to previous contents of file otherwise it create a new text file

<br />
Private Sub CreateTextFile(ByVal FilePath As String, ByVal data As String)<br />
        Dim oFile As System.IO.File<br />
        Dim oWrite As System.IO.StreamWriter<br />
        Dim oRead As System.IO.StreamReader<br />
        Dim PreviousData As String = ""<br />
        Dim CheckHypen As String<br />
<br />
        If File.Exists(FilePath) Then<br />
            oRead = oFile.OpenText(FilePath)<br />
            While oRead.Peek <> -1<br />
                If PreviousData = "" Then<br />
                    PreviousData = oRead.ReadLine()<br />
                Else<br />
                    <br />
                    PreviousData = PreviousData & ControlChars.NewLine & oRead.ReadLine()<br />
                   <br />
                End If<br />
            End While<br />
            oRead.Close()<br />
        End If<br />
<br />
<br />
        oWrite = oFile.CreateText(FilePath)<br />
<br />
        If PreviousData = "" Then<br />
            oWrite.WriteLine(data)<br />
        Else<br />
            oWrite.WriteLine(PreviousData & ControlChars.NewLine & data)<br />
        End If<br />
        oWrite.Close()<br />
<br />
    End Sub


i don't specify encoding format . some time text file is created with ANSI encoding format and sometime UTF-8 encoding format(dependent upon content). my problem is that i strictly create file as ANSI encoding.how it is possible?

How can i set text file Encoding format to ANSI?

any help will be appreciated.



Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)

AnswerRe: Create Text file as ANSI encoding Format Pin
iprasad00718-Jun-07 21:45
iprasad00718-Jun-07 21:45 
GeneralRe: Create Text file as ANSI encoding Format Pin
Rupesh Kumar Swami18-Jun-07 22:10
Rupesh Kumar Swami18-Jun-07 22:10 
GeneralRe: Create Text file as ANSI encoding Format Pin
iprasad00718-Jun-07 23:25
iprasad00718-Jun-07 23:25 
GeneralRe: Create Text file as ANSI encoding Format Pin
Rupesh Kumar Swami19-Jun-07 0:11
Rupesh Kumar Swami19-Jun-07 0:11 
QuestionSystem inforamtion Pin
sathishtl00718-Jun-07 20:50
sathishtl00718-Jun-07 20:50 
AnswerRe: System inforamtion Pin
Sathesh Sakthivel18-Jun-07 20:56
Sathesh Sakthivel18-Jun-07 20:56 
Questionpdf Pin
WhiteGirl2318-Jun-07 19:59
WhiteGirl2318-Jun-07 19:59 
AnswerRe: pdf Pin
Christian Graus18-Jun-07 20:04
protectorChristian Graus18-Jun-07 20:04 
QuestionWriting the date through registry editor during installation. Pin
tonymathewt18-Jun-07 19:06
professionaltonymathewt18-Jun-07 19:06 
AnswerRe: Writing the date through registry editor during installation. Pin
Sathesh Sakthivel18-Jun-07 19:44
Sathesh Sakthivel18-Jun-07 19:44 
AnswerRe: Writing the date through registry editor during installation. Pin
Dave Kreskowiak19-Jun-07 4:50
mveDave Kreskowiak19-Jun-07 4:50 
GeneralRe: Writing the date through registry editor during installation. Pin
tonymathewt19-Jun-07 18:22
professionaltonymathewt19-Jun-07 18:22 
QuestionVB.NET UserControl Click Issue Pin
JB of Three18-Jun-07 9:52
JB of Three18-Jun-07 9:52 
AnswerRe: VB.NET UserControl Click Issue Pin
Dave Kreskowiak18-Jun-07 10:00
mveDave Kreskowiak18-Jun-07 10:00 
QuestionGlobal Data set Usage for multiple SP querries Pin
mrarunks18-Jun-07 7:32
mrarunks18-Jun-07 7:32 
AnswerRe: Global Data set Usage for multiple SP querries Pin
Dave Kreskowiak18-Jun-07 9:56
mveDave Kreskowiak18-Jun-07 9:56 
AnswerRe: Global Data set Usage for multiple SP querries Pin
MidwestLimey18-Jun-07 10:06
professionalMidwestLimey18-Jun-07 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.