|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
HELP - TextWriter.Insert
Hi,
With VS 2003 and VB .NET I am trying to add a dateTime to every line in a text file - and while the following code displays the results I expect on the console - it does not actually make the changes to the textFile. So my question is - how to I code for making the expected changes to the actual textFile? Dim fName AsString = "C:\tvcFileIn.txt" Dim dt As DateTime dt = String.Format("{0:u}", Now()) Dim readLine As Stream Dim sw As TextWriter Dim sb As StringBuilder readLine = File.OpenRead(fName) sw = Console.Out Dim sReader AsNew StreamReader(readLine) Try sReader.BaseStream.Seek(0, SeekOrigin.Begin) While (sReader.Peek() > -1) sb = New StringBuilder(sReader.ReadLine()) sb.Insert(0, dt & ",") sw.WriteLine(sb.ToString) EndWhile sReader.Close() Console.WriteLine("DONE") Catch objE As Exception Call handleExc("wwd", objE) Finally EndTry EndSub Thanks mb |
|
#2
|
||||
|
||||
|
This question should have been posted in the .NET area, since it pertains to .NET
|
|
#3
|
|||
|
|||
|
Oops
Thanks - I reposted in .NET
mb |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > HELP - TextWriter.Insert |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|