lilgirl Posted August 21, 2003 Posted August 21, 2003 Hi, Is there a particular vb.net class that would allow me to run a program using telnet to log into the particular server i want to access without making the user deal with telnet? Basically, I want a button on a vb form that when clicked, runs a program that is stored on a server you can access through telnet. Thanks. Quote
Administrators PlausiblyDamp Posted August 21, 2003 Administrators Posted August 21, 2003 If you want to connect to a remote telnet server you should have a look under System.Net.Sockets. The TCPClient class will allow you to open a connection to the telnet server and obtain a stream. You can then send / receive data quite easily. What language would you be coding in? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
KalenDB Posted August 21, 2003 Posted August 21, 2003 Im trying somthing similiar I think. See if this is any help This will connect to a machine and read the inital text sent back, and store it in a log file Imports System.Net.Sockets Imports System.Net Imports System.Text Module Module1 Sub Main() Dim tcpClient1 As New TcpClient() Dim NS As NetworkStream Dim bytes(tcpClient1.ReceiveBufferSize) As Byte Dim hostaddr1 As IPAddress = IPAddress.Parse("127.0.0.1") Dim MyEndPoint1 As New IPEndPoint(hostaddr1, 23) Dim buffsize As Integer Dim buff2 As String FileOpen(1, "C:\logfile.txt", OpenMode.Output) tcpClient1.Connect(MyEndPoint1) NS = tcpClient1.GetStream ReDim bytes(tcpClient1.ReceiveBufferSize) buffsize = CInt(tcpClient1.ReceiveBufferSize) If NS.DataAvailable Then NS.Read(bytes, 0, buffsize) buff2 = Encoding.ASCII.GetString(bytes) Print(1, buff2) End If FileClose(1) End Sub End Module Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.