|
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.
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
|
|
|
|
|
I really wanted to make that work, I'll just save it for another day. Just wanted to work with bytes for the experience.
I ended up just using 3 lines of code using textwriter before your post, but switched to your example for 5 lines and UTF8
On the read side I did the same thing in reverse. But I just changed that to the opposite of your example.
Now everything works from start to finish. Just modified everything and tested it 10 different ways.
Well thanks for the KISS, I made something really simple complex.
|
|
|
|
|
I'm writing a program in VB.NET and try to save different profiles via the application settings (project settings -> settings tab).
I created a Profile class and a collection class of that. If I choose this collection as settings type, I can add multiple objects with type System.Object, but I need to add my Profile object.
How can I add a collection of my Profile objects with the settings editor? Whats wrong with my code?
Profile.vb
Imports System.Configuration
<SettingsSerializeAs(Configuration.SettingsSerializeAs.Xml)> _
Public Class Profile
Public Property Name As String
Public Property ViewerCommand As String
Public Property ViewerPath As String
Public Property StartService As Boolean
Public Property StopService As Boolean
End Class
<SettingsSerializeAs(Configuration.SettingsSerializeAs.Xml)> _
Public Class ProfileCollection
Inherits CollectionBase
Public Shadows Function Add(ByVal ProfileObject As Profile) As Profile
MyBase.List.Add(ProfileObject)
Return ProfileObject
End Function
Public Shadows Sub Remove(ByVal ProfileObject As Profile)
MyBase.List.Remove(ProfileObject)
End Sub
End Class
A screenshot of the current behavior
The type is VNC_Manager.ProfileCollection for the setting called "Profiles".
http://i.stack.imgur.com/4Oaf8.png[^]
On the right side there should be Name, ViewerCommand, ...
If I use VNC_Manager.Profile for type, I also can't see Name, ViewerCommand... So there seems to be a problem with the Profile class(?)
|
|
|
|
|
|
vb.net code for convert a wav file to mp3 file
|
|
|
|
|
If you're looking for someone to write this code for you, you've come to the wrong place.
If you're looking for example code, type the text from your post into Google and start reading. This is what is called "research".
|
|
|
|
|
Yeah, Google it with your favourite search engine (see the lounge postings for ideas).
|
|
|
|
|
Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
multidimensional hierarchy is needed for my report ............. please help me .
my query is like below
SHAPE {SELECT * FROM job_table WHERE job_id = ?} AS parentCMD APPEND ({SELECT *
FROM ((job_table AS p INNER JOIN
job_team AS jt ON p.job_id = jt.job_id) INNER JOIN
Team_Member AS tm ON jt.Member_ID = tm.Member_ID)} AS childCMD RELATE 'job_id' TO 'p.job_id') AS childCMD,({SELECT *
FROM (job_table AS jobTBL INNER JOIN
job_tjb AS jt ON jobTBL.job_id = jt.job_id)} AS tjbCMD RELATE 'job_id' TO 'jobTBL.job_id') AS tjbCMD
|
|
|
|
|
Upgrade to a programming language that is less than 10 years out of date?
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
|
If you provide a code sample of what you've done, you are much more likely to receive assistance.
Simply asking someone to do the work for you if unlikely to produce any positive results.
|
|
|
|
|
There are a million and 1 ways to do this. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Down vote countered - I was going to be a little more cutting in my remarks to the OP.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
So... you ask for help. People advise you to provide what you've done... and you insult them?
Not a good way to get help...
|
|
|
|
|
|
I don't know what you were expecting. All you did was post your assignment but none of the work you've already done. At no point did you say anything about what problem you were having. Without that, it's impossible to help with any accuracy or clarity.
We will help with the code you're having a problem with IF you prove you've done some work and are stuck.
We will NOT do your work for you.
|
|
|
|
|
I will forever be in your gratitude if you do this
|
|
|
|
|
WHAT DID I JUST TELL YOU???
WE WILL NOT DO YOUR WORK FOR YOU!
It is set that way for a reason. The industry has too many idiot programmers who couldn't debug their way out of a paper bag and you want us to add to that pool?!?!
Doing your work for you doesn't teach you a damn thing!
Sorry, but you just failed your class.
|
|
|
|
|
|
Duck before the bullets hit you, not after.
|
|
|
|
|
Okay thank you very helpful at this time. Thank you. Thank you. Please understand my pain
|
|
|
|
|
No. YOU have to understand OUR pain.
Understand that to be in the workforce YOU must do the work. You DON'T go around asking other people to do your work for you when you find it too hard or you can't understand it.
|
|
|
|
|
OI am not going to do coding as a profession. this is just a school assignment that i have no idea how to do and the teacher can't explain sh*t
|
|
|
|