Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
c# Send telnet command WinForms
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="BIOS" data-source="post: 462669" data-attributes="member: 15674"><p>I'd recommend avoiding Telnet as it is an old unencrypted protocol. You'd probably be better using something like UNIX (or regular TCP) sockets for this, depending on what you're trying to achieve. Is the host always on the local machine, or sometimes remote?</p><p></p><p>You can use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient.connect?view=netcore-3.1" target="_blank">TcpClient.Connect</a> for that or <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.unixdomainsocketendpoint?view=netstandard-2.1" target="_blank">UnixDomainSocketEndPoint</a>. You'll need to create a listener on the server to read the incoming data (see example: <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcplistener?view=netcore-3.1" target="_blank">https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcplistener?view=netcore-3.1</a> ).</p><p></p><p>As for the button press thing, you can probably create an event handler (<a href="https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.click?view=netframework-4.8" target="_blank">https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.click?view=netframework-4.8</a> ) to catch when the button is pressed and then call this code.</p></blockquote><p></p>
[QUOTE="BIOS, post: 462669, member: 15674"] I'd recommend avoiding Telnet as it is an old unencrypted protocol. You'd probably be better using something like UNIX (or regular TCP) sockets for this, depending on what you're trying to achieve. Is the host always on the local machine, or sometimes remote? You can use [URL='https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient.connect?view=netcore-3.1']TcpClient.Connect[/URL] for that or [URL='https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.unixdomainsocketendpoint?view=netstandard-2.1']UnixDomainSocketEndPoint[/URL]. You'll need to create a listener on the server to read the incoming data (see example: [URL]https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcplistener?view=netcore-3.1[/URL] ). As for the button press thing, you can probably create an event handler ([URL]https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.click?view=netframework-4.8[/URL] ) to catch when the button is pressed and then call this code. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
c# Send telnet command WinForms
Top