Dim bytes(999) As Byte
Dim fs As New IO.FileStream("1kbfile", FileMode.Create, FileAccess.Write)
fs.Write(bytes, 0, bytes.Length)
fs.Close()
VB.NET:Dim bytes(999) As Byte [/QUOTE] Dim bytes(1024) As Byte, surely!? ;) But maybe easier something like (not syntax checked): File.WriteAllText(Iif(myString.Length > 1024, myString.Substring(0,1024), myString), Encoding.ASCII)
I usually read small "k" as SI unit kilo (1000), large "K" as non-standardized legacy/computer kilo (1024). Also bytes(1024) would be 1025 bytes...Dim bytes(1024) As Byte, surely!?
But maybe easier something like (not syntax checked):
File.WriteAllText(Iif(myString.Length > 1024, myString.Substring(0,1024), myString), Encoding.ASCII)
Bwahahaah.. John, dang.. You kill me, you really do. Youre a proper funny guy, and I love your posts. Hopefully you'll find it a compliment to know I think of you like I do Data in Star Trek - hilarious and amazing because he's absolutely right on every occasion and works with infallible precision.I usually read small "k" as SI unit kilo (1000), large "K" as non-standardized legacy/computer kilo (1024).
Indeed, that's one of those VB idiosyncracies (stupidities IMHO) that a C# programmer will forget quite easily..Also bytes(1024) would be 1025 bytes...
And I'm normally pretty good with that too. Good to know that when I'm wrong on the 1% of occasions, there's John as the backup.. You want a job?.Net 1 doesn't have a WriteAllText method.
It's the little differences... anyway OP should get the idea from both suggestions.Indeed, that's one of those VB idiosyncracies (stupidities IMHO) that a C# programmer will forget quite easily..
I'm fully booked for the time being, but thanks for offerYou want a job?