Click here to Skip to main content
15,849,030 members
Home / Discussions / C#
   

C#

 
GeneralRe: FPS convertor Pin
walterhevedeich23-Jul-13 21:23
professionalwalterhevedeich23-Jul-13 21:23 
GeneralRe: FPS convertor Pin
harold aptroot24-Jul-13 1:13
harold aptroot24-Jul-13 1:13 
GeneralRe: FPS convertor Pin
_Q12_25-Jul-13 7:27
_Q12_25-Jul-13 7:27 
GeneralRe: FPS convertor Pin
harold aptroot25-Jul-13 8:04
harold aptroot25-Jul-13 8:04 
GeneralRe: FPS convertor Pin
_Q12_25-Jul-13 8:21
_Q12_25-Jul-13 8:21 
QuestionHow to authorize user by form authentication in mvc 4 Pin
nitin_ion23-Jul-13 3:35
nitin_ion23-Jul-13 3:35 
AnswerRe: How to authorize user by form authentication in mvc 4 Pin
Keith Barrow23-Jul-13 7:29
professionalKeith Barrow23-Jul-13 7:29 
QuestionGet string in a function using Socket server Pin
CodingHell22-Jul-13 22:02
CodingHell22-Jul-13 22:02 
I'm creating a socket server in which I'm getting a string like this.
C#
 IPEndPoint ipEnd = new IPEndPoint(IPAddress.Any, 5656);
            Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
            sock.Bind(ipEnd);
            sock.Listen(100);
            Socket clientSock = sock.Accept();
           
            while (true)
            {
                clientData = new byte[1024];
                receivedBytesLen = clientSock.Receive(clientData);
                clientDataInString = Encoding.ASCII.GetString(clientData, 0, receivedBytesLen);
 Console.WriteLine("Received Data{0}",clientDataInString);

if(clientDataInString.Contains("Start"))
{
.....any method call....

}
}


I want to use this clientDataInString or the received string in another method.

Like this:
C#
void abc()
{
if(clientDatainString.containg("A"))
{
Console.Writeline("Print A");


}
else if(clientDatainString.containg("B"))
{
Console.Writeline("Print B");

}


}


How can I use this String like this?
Please Suggest..
AnswerRe: Get string in a function using Socket server Pin
Richard MacCutchan22-Jul-13 22:09
mveRichard MacCutchan22-Jul-13 22:09 
GeneralRe: Get string in a function using Socket server Pin
CodingHell22-Jul-13 22:18
CodingHell22-Jul-13 22:18 
AnswerRe: Get string in a function using Socket server Pin
Richard MacCutchan23-Jul-13 0:39
mveRichard MacCutchan23-Jul-13 0:39 
AnswerRe: Get string in a function using Socket server Pin
lukeer23-Jul-13 0:39
lukeer23-Jul-13 0:39 
QuestionApplication Settings Pin
Midnight Ahri22-Jul-13 19:31
Midnight Ahri22-Jul-13 19:31 
QuestionRe: Application Settings Pin
Kenneth Haugland22-Jul-13 23:48
mvaKenneth Haugland22-Jul-13 23:48 
AnswerRe: Application Settings Pin
Midnight Ahri23-Jul-13 0:40
Midnight Ahri23-Jul-13 0:40 
AnswerRe: Application Settings Pin
lukeer23-Jul-13 0:09
lukeer23-Jul-13 0:09 
AnswerRe: Application Settings Pin
Midnight Ahri23-Jul-13 0:47
Midnight Ahri23-Jul-13 0:47 
GeneralRe: Application Settings Pin
Eddy Vluggen23-Jul-13 1:29
professionalEddy Vluggen23-Jul-13 1:29 
QuestionResponsive UI - WPF with Properties Pin
SynergiAios22-Jul-13 16:09
SynergiAios22-Jul-13 16:09 
AnswerRe: Responsive UI - WPF with Properties Pin
Dave Kreskowiak22-Jul-13 17:32
mveDave Kreskowiak22-Jul-13 17:32 
GeneralRe: Responsive UI - WPF with Properties Pin
SynergiAios23-Jul-13 1:18
SynergiAios23-Jul-13 1:18 
QuestionOO Design for Specifc Problem Pin
KeithF22-Jul-13 7:17
KeithF22-Jul-13 7:17 
AnswerRe: OO Design for Specifc Problem Pin
KeithF22-Jul-13 22:41
KeithF22-Jul-13 22:41 
AnswerRe: OO Design for Specifc Problem Pin
Eddy Vluggen23-Jul-13 1:30
professionalEddy Vluggen23-Jul-13 1:30 
GeneralRe: OO Design for Specifc Problem Pin
KeithF30-Jul-13 23:49
KeithF30-Jul-13 23:49 

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.