Ok, I see... let me amend the code and tinker a bit... the next step will be to get this to automatically kick out data from an input to the device... but I have a good handle on how the print stream works... I'll condense it down... thanks!!!
Edit - I put your code in there... works perfectly...
Oh... cool! (I only knew about the [CODE] tag... )
Thanks for that!
Jerry
Let me test that...
// - Append more text
using (var writer = new StreamWriter(myfile,true))
{
writer.Write(Iarray[myCounter].ToString("D2") + ",")...
I understand that... but so far... I haven't quite figured out how not to do that... if I can make this application work... albeit sloppy... I can bid on a job to collect data and compile into a report... at some future date... I can clean it up and resell as a professional application. But for...
If I get knocked in the head long enough... it eventually sticks. :friendly_wink:
I really appreciate your help... and patience... it worked perfectly this time...
if (saveFileDialog1.FileName != "")
{...
So put this in once...
using (FileStream fs = new FileStream(saveFileDialog1.FileName, FileMode.OpenOrCreate))
Then... just use this...
using (StreamWriter writer = new StreamWriter(fs))
{
writer.Write(somestring);
}...
That's what I find confusing... I'm running the operations in parallel...
Update Textbox;
Update File;
...
...
Update Textbox;
Update File;
...
...
Then... the textbox has something completely different than the file... the textbox is perfect... but the file only contains a few characters.
I...
I didn't see your post... I added more details above... the StreamWriter is working... at least it's not failing... but it is not outputting the expected data.
I was getting errors... then I realized that for the "using" parameter... I needed to add...
using System.IO; to the top of the code.... pressing on... one step closer.
So here is the code...
if (saveFileDialog1.FileName != "")
{...
So if I understand you... then it's okay to use this part to get the user's request for where to put the file...
//----------- Put a file somewhere -----------------------------------------------------------
SaveFileDialog saveFileDialog1 = new SaveFileDialog()...
I feel like such a NOOBE... been programming in C# for about 3 hours now... so I guess I am. :rapture:
Anyway... I'm stuck on what is likely C# 101 stuff... I programmed code to talk to a USB device, create a file, pull data from the device... I just want to print it to the file.
I have a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.