Click here to Skip to main content
15,920,596 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can I capture the screen with cursor? Pin
Heath Stewart21-Oct-03 6:47
protectorHeath Stewart21-Oct-03 6:47 
GeneralControl Button Doubleclick Pin
Mr. Labenche20-Oct-03 21:46
Mr. Labenche20-Oct-03 21:46 
GeneralRe: Control Button Doubleclick Pin
Heath Stewart21-Oct-03 6:51
protectorHeath Stewart21-Oct-03 6:51 
GeneralRe: Control Button Doubleclick Pin
Mr. Labenche21-Oct-03 23:16
Mr. Labenche21-Oct-03 23:16 
GeneralRe: Control Button Doubleclick Pin
Heath Stewart22-Oct-03 2:52
protectorHeath Stewart22-Oct-03 2:52 
GeneralRe: Control Button Doubleclick Pin
Mr. Labenche22-Oct-03 3:07
Mr. Labenche22-Oct-03 3:07 
GeneralRe: Control Button Doubleclick Pin
Heath Stewart22-Oct-03 3:18
protectorHeath Stewart22-Oct-03 3:18 
QuestionHow to connect to a Solaris Unix box from .NET using sockets or tcpclient Pin
Buckin20-Oct-03 21:44
Buckin20-Oct-03 21:44 
I am trying to access a Solaris Unix box from .Net windows form application using sockets or tcpclient classes. I need to send and execute some type of command script that can disable and enable ip/ports on the unix box.

I am not use to the unix environment, therefore I may be doing this totally wrong. If anyone has any code already to share with me that would be great!!Smile | :)

The problem is reading data from a Solaris Unix box. I can get connected to the IP and Port, I can also write to it, but when I read from it nothing happens. No error is produced, no timeout is produced, it just hangs there.

If I Telnet into the same IP I get a login screen. Could this be the hang up? Should I be passing a login and password first?

Below is my code that I am using:

IPAddress myIP = IPAddress.Parse(strIP);
string sszPort = strPORT;
int alPortt = System.Convert.ToInt16 (sszPort,10);
TcpClient Telnet = new TcpClient();
try
{

Telnet.Connect(myIP, alPortt);
Stream TelnetStream = Telnet.GetStream();
if(TelnetStream.CanRead & TelnetStream.CanWrite)
{
MessageBox.Show ("Can Read and Write");

byte[] sendBytes = System.Text.Encoding.ASCII.GetBytes("USER <username>\r\n");

TelnetStream.Write(sendBytes, 0, sendBytes.Length);

byte[] bytes = new byte[Telnet.ReceiveBufferSize];

TelnetStream.Read(bytes, 0, bytes.Length);

returndata = Encoding.ASCII.GetString(bytes);

MessageBox.Show("This is what the host returned to you: " + returndata);

}
else
{
MessageBox.Show("Cannot Read");
}
catch(Exception ee)
{
string excepstr = ee.Message;
}


Telnet.Close();
AnswerRe: How to connect to a Solaris Unix box from .NET using sockets or tcpclient Pin
Heath Stewart21-Oct-03 6:53
protectorHeath Stewart21-Oct-03 6:53 
GeneralHelp in color of Datagrid Pin
erbest20-Oct-03 17:49
erbest20-Oct-03 17:49 
GeneralAdvice Pin
gadgetfbi20-Oct-03 16:17
gadgetfbi20-Oct-03 16:17 
GeneralRe: Advice Pin
Guillermo Rivero20-Oct-03 16:47
Guillermo Rivero20-Oct-03 16:47 
GeneralRe: Advice Pin
Bo Hunter20-Oct-03 18:05
Bo Hunter20-Oct-03 18:05 
GeneralRe: Advice Pin
leppie21-Oct-03 8:59
leppie21-Oct-03 8:59 
GeneralMultilple Monitors Pin
Jeff Monheiser20-Oct-03 9:00
Jeff Monheiser20-Oct-03 9:00 
GeneralRe: Multilple Monitors Pin
igor196020-Oct-03 9:36
igor196020-Oct-03 9:36 
GeneralRe: Multilple Monitors Pin
Heath Stewart20-Oct-03 10:35
protectorHeath Stewart20-Oct-03 10:35 
GeneralRe: Multilple Monitors Pin
leppie21-Oct-03 11:58
leppie21-Oct-03 11:58 
QuestionWhats wrong with this datagrid code? Pin
RB@Emphasys20-Oct-03 8:32
RB@Emphasys20-Oct-03 8:32 
AnswerRe: Whats wrong with this datagrid code? Pin
RB@Emphasys20-Oct-03 8:46
RB@Emphasys20-Oct-03 8:46 
GeneralRe: Whats wrong with this datagrid code? Pin
RB@Emphasys20-Oct-03 8:49
RB@Emphasys20-Oct-03 8:49 
GeneralAsyncCallBack and COM+ Pin
rick close20-Oct-03 8:09
rick close20-Oct-03 8:09 
GeneralRe: AsyncCallBack and COM+ Pin
Guillermo Rivero21-Oct-03 4:12
Guillermo Rivero21-Oct-03 4:12 
GeneralMouse Location Pin
Gary Kirkham20-Oct-03 7:30
Gary Kirkham20-Oct-03 7:30 
GeneralRe: Mouse Location Pin
Andreas Philipson20-Oct-03 8:24
Andreas Philipson20-Oct-03 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.