add a button that send output to a notepad

steveosh

Member
Joined
May 19, 2021
Messages
6
Programming Experience
Beginner
Hi there - i have an old app that i created with some help a few years ago.

I'd like to add a button that would send what would of been the results to a notepad so a person could see what was going to be sent.

you connect to another piece of equipment using SSH - and instead of sending the "programming" to the piece of equipment you click on a button and it sends it to a notepad document that show what would of been sent.

help pic2.JPG
 
There's not really any such thing as a Notepad file. Notepad is just a basic text editor, so it will edit basic text files. In .NET, creating a text file basically means creating a StreamWriter and calling its Write and/or WriteLine method as required. We don't know exactly what you want to write, so we can't really go into specifics about how you'd write it, other than to say that you should creating it with a using statement:
C#:
using (var writer = new StreamWriter(filePath))
{
    // Use writer here.
}
Note that, if you just have a single string to save or a list of strings, you can call File.WriteAllText or File.WriteAllLines and let that look after the StreamWriter internally.
 
There's not really any such thing as a Notepad file. Notepad is just a basic text editor, so it will edit basic text files. In .NET, creating a text file basically means creating a StreamWriter and calling its Write and/or WriteLine method as required. We don't know exactly what you want to write, so we can't really go into specifics about how you'd write it, other than to say that you should creating it with a using statement:
C#:
using (var writer = new StreamWriter(filePath))
{
    // Use writer here.
}
Note that, if you just have a single string to save or a list of strings, you can call File.WriteAllText or File.WriteAllLines and let that look after the StreamWriter internally.

Each one of those text boxes on the program is filled out its either a check box or a text box.... and depending on whats "filled out or checkez off" a specific set of commands are sent to the device its connected too...

For example if the check box next to the word MODE is checked off and the text box the user filled out with 29.

Then the instruction that would program an interface with that mode 29. If the user filled out the description box ... it would send the code to program that interface with that description...
 
Firstly, there's no need to quote an entire post when you're just making a general reply. Only quote a post if you need to draw attention to something specific that you're responding to and then only the relevant part. Otherwise, you're just making the thread longer and harder to read for no good reason.

As for the issue, your description is still too vague for us to know exactly what you expect to be written but presumably you know, so go ahead and write and then post back if it doesn't work. I've told you what you need to do so now you should do it. We can still help further if you need it but you don't know that you need it if you haven't tried anything yet.
 
First i was on my phone, which this site is not made for, second i just hit reply, i didnt copy anything.

thirdly you dont need to be a jack A$$ about it. i am new to C# and needed a easy answer. but i see i am wasting my time.
 
There is the quick reply text area at the bottom of the thread. No real need for the Reply button unless you want to quote something.
 
Unfortunately there is no easy right now because you are not giving us enough information. Show us the the code that you are using to talk to the device. That will give us an inkling of how to respond that minimizes the rework you may need to do. Or if there is no way to minimize the rework, how to refactor your code so that a lot can be reused between sending to a device and sending to a text file.

Why all the secrecy? In your thread about 2 years ago, you posted the UI without hiding anything:
1734650470640.jpeg
 
Back
Top Bottom