Click here to Skip to main content
15,885,933 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSynchronization of camera and shell orientation Windows 8.1 Surface Pin
Member 110572154-Sep-14 3:33
Member 110572154-Sep-14 3:33 
QuestionCopy selected listview item to a textbox VB.NET Pin
Pete_1233-Sep-14 5:49
Pete_1233-Sep-14 5:49 
AnswerRe: Copy selected listview item to a textbox VB.NET Pin
Eddy Vluggen3-Sep-14 7:14
professionalEddy Vluggen3-Sep-14 7:14 
QuestionRe: Copy selected listview item to a textbox VB.NET Pin
Pete_1234-Sep-14 7:01
Pete_1234-Sep-14 7:01 
AnswerRe: Copy selected listview item to a textbox VB.NET Pin
Eddy Vluggen4-Sep-14 8:15
professionalEddy Vluggen4-Sep-14 8:15 
AnswerRe: Copy selected listview item to a textbox VB.NET Pin
Tino Fourie24-Sep-14 6:49
Tino Fourie24-Sep-14 6:49 
Questionstring to byte, having trouble with line feed characters Pin
jkirkerx1-Sep-14 10:15
professionaljkirkerx1-Sep-14 10:15 
AnswerRe: string to byte, having trouble with line feed characters Pin
Dave Kreskowiak1-Sep-14 11:19
mveDave Kreskowiak1-Sep-14 11:19 
Yeah, that's doing it ........how can I put this........ the hard way.

How about using an overload of the StreamWriter class to handle all the crap for you? Oh, and you don't even have to call ToString on the StringBuilder.
VB
Sub Main()

    Dim sb As New StringBuilder()

    sb.AppendFormat("Some formatted text containing {0} lines..." & Environment.NewLine, 3)
    sb.AppendLine("You don't need vbCrLf at the end of every line if you use the ")
    sb.AppendLine("AppendLine method of the StringBuilder instead of Append.")

    Using fs As New FileStream("C:\Text.txt", FileMode.Create)
        Using sw As New StreamWriter(fs, Encoding.UTF8)
            sw.Write(sb)
        End Using
    End Using

End Sub

A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

GeneralRe: string to byte, having trouble with line feed characters Pin
jkirkerx1-Sep-14 12:09
professionaljkirkerx1-Sep-14 12:09 
QuestionHow to use own collections in application settings in VB.NET? Pin
ponchofiesta31-Aug-14 21:35
ponchofiesta31-Aug-14 21:35 
AnswerRe: How to use own collections in application settings in VB.NET? Pin
Eddy Vluggen1-Sep-14 0:27
professionalEddy Vluggen1-Sep-14 0:27 
Questionwav to mp3 Pin
Ali Asgar29-Aug-14 4:52
Ali Asgar29-Aug-14 4:52 
AnswerRe: wav to mp3 Pin
Dave Kreskowiak29-Aug-14 5:05
mveDave Kreskowiak29-Aug-14 5:05 
GeneralRe: wav to mp3 Pin
Tim Carmichael29-Aug-14 6:28
Tim Carmichael29-Aug-14 6:28 
QuestionRe: wav to mp3 Pin
ZurdoDev29-Aug-14 5:38
professionalZurdoDev29-Aug-14 5:38 
QuestionVB6: error- report writer does not support multidimensional hierarchy Pin
Member 1102617826-Aug-14 3:20
Member 1102617826-Aug-14 3:20 
AnswerRe: VB6: error- report writer does not support multidimensional hierarchy Pin
Chris Quinn26-Aug-14 22:12
Chris Quinn26-Aug-14 22:12 
QuestionMessage Closed Pin
25-Aug-14 1:15
Jashan12325-Aug-14 1:15 
SuggestionRe: Algorithms to Visual Basic Code Pin
Tim Carmichael25-Aug-14 1:58
Tim Carmichael25-Aug-14 1:58 
QuestionRe: Algorithms to Visual Basic Code Pin
ZurdoDev25-Aug-14 2:07
professionalZurdoDev25-Aug-14 2:07 
AnswerRe: Algorithms to Visual Basic Code Pin
Mycroft Holmes25-Aug-14 12:29
professionalMycroft Holmes25-Aug-14 12:29 
GeneralMessage Closed Pin
26-Aug-14 2:52
Jashan12326-Aug-14 2:52 
GeneralRe: Algorithms to Visual Basic Code Pin
Tim Carmichael26-Aug-14 3:05
Tim Carmichael26-Aug-14 3:05 
GeneralMessage Closed Pin
26-Aug-14 3:15
Jashan12326-Aug-14 3:15 
GeneralRe: Algorithms to Visual Basic Code Pin
Dave Kreskowiak26-Aug-14 3:17
mveDave Kreskowiak26-Aug-14 3:17 

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.