Click here to Skip to main content
15,889,877 members
Home / Discussions / C#
   

C#

 
JokeRe: this.Height size issue Pin
tarquinn cook23-Feb-09 1:59
tarquinn cook23-Feb-09 1:59 
QuestionError while debugging Pin
ayazmingora23-Feb-09 0:45
ayazmingora23-Feb-09 0:45 
AnswerRe: Error while debugging Pin
Rob Philpott23-Feb-09 1:33
Rob Philpott23-Feb-09 1:33 
GeneralRe: Error while debugging Pin
ayazmingora23-Feb-09 1:50
ayazmingora23-Feb-09 1:50 
Jokehello Pin
amitkumarpratap23-Feb-09 0:07
amitkumarpratap23-Feb-09 0:07 
QuestionClient Pin
mrithula822-Feb-09 23:51
mrithula822-Feb-09 23:51 
AnswerRe: Client Pin
Rob Philpott22-Feb-09 23:59
Rob Philpott22-Feb-09 23:59 
GeneralRe: Client Pin
mrithula823-Feb-09 2:06
mrithula823-Feb-09 2:06 
Hi i am sorry i pasted the server code instead of the client in the previous post..
This is the code for the client
the line
tcpclnt.Connect("192.168.0.2",8001);
gives me the error
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Net.Sockets;



public class clnt {

	public static void Main() {
		
		try {
			TcpClient tcpclnt = new TcpClient();
			Console.WriteLine("Connecting.....");
			
			tcpclnt.Connect("192.168.0.2",8001); // use the ipaddress as in the server program
			
			Console.WriteLine("Connected");
			Console.Write("Enter the string to be transmitted : ");
			
			String str=Console.ReadLine();
			Stream stm = tcpclnt.GetStream();
						
			ASCIIEncoding asen= new ASCIIEncoding();
			byte[] ba=asen.GetBytes(str);
			Console.WriteLine("Transmitting.....");
			
			stm.Write(ba,0,ba.Length);
			
			byte[] bb=new byte[100];
			int k=stm.Read(bb,0,100);
			
			for (int i=0;i<k;i++)>
				Console.Write(Convert.ToChar(bb[i]));
			
			tcpclnt.Close();
		}
		
		catch (Exception e) {
			Console.WriteLine("Error..... " + e.StackTrace);
		}
	}

}

GeneralRe: Client Pin
Greg Chelstowski23-Feb-09 2:29
Greg Chelstowski23-Feb-09 2:29 
GeneralRe: Client Pin
mrithula823-Feb-09 2:53
mrithula823-Feb-09 2:53 
GeneralRe: Client Pin
Greg Chelstowski23-Feb-09 3:09
Greg Chelstowski23-Feb-09 3:09 
GeneralRe: Client Pin
Mel Feik23-Feb-09 10:54
Mel Feik23-Feb-09 10:54 
Question[Message Deleted] Pin
yesu prakash22-Feb-09 23:11
yesu prakash22-Feb-09 23:11 
AnswerRe: Voice conference using socket [modified] Pin
Deresen23-Feb-09 1:49
Deresen23-Feb-09 1:49 
GeneralRe: Voice conference using socket Pin
EliottA23-Feb-09 2:45
EliottA23-Feb-09 2:45 
GeneralRe: Voice conference using socket Pin
yesu prakash1-Mar-09 19:09
yesu prakash1-Mar-09 19:09 
GeneralRe: Voice conference using socket Pin
Deresen1-Mar-09 22:25
Deresen1-Mar-09 22:25 
GeneralRe: Voice conference using socket Pin
Gira Palmer3-Jun-11 3:40
Gira Palmer3-Jun-11 3:40 
QuestionHttpWebResponse timeout subsequently if I do not download the file but looking at the LastModified property only. Pin
Shao Voon Wong22-Feb-09 23:08
mvaShao Voon Wong22-Feb-09 23:08 
AnswerRe: HttpWebResponse timeout subsequently if I do not download the file but looking at the LastModified property only. Pin
Rob Philpott22-Feb-09 23:57
Rob Philpott22-Feb-09 23:57 
Questionan oaep padding error occured in asp.net Pin
venki5422-Feb-09 22:55
venki5422-Feb-09 22:55 
QuestionHello ,Pls help me ,How to retrieve image from database (sqlserver 2005) to imabe button?(Asp.net c#+) [modified] Pin
muhammadafsal22-Feb-09 22:50
muhammadafsal22-Feb-09 22:50 
AnswerRe: Hello ,Pls help me ,How to retrieve image from database (sqlserver 2005) to imabe button?(Asp.net c#+) Pin
Calin Tatar23-Feb-09 0:21
Calin Tatar23-Feb-09 0:21 
GeneralRe: Hello ,Pls help me ,How to retrieve image from database (sqlserver 2005) to imabe button?(Asp.net c#+) Pin
muhammadafsal23-Feb-09 0:36
muhammadafsal23-Feb-09 0:36 
GeneralRe: Hello ,Pls help me ,How to retrieve image from database (sqlserver 2005) to imabe button?(Asp.net c#+) Pin
Calin Tatar23-Feb-09 0:39
Calin Tatar23-Feb-09 0:39 

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.