Click here to Skip to main content
15,909,953 members
Home / Discussions / C#
   

C#

 
AnswerRe: WebBrowser control without Form hosting Pin
Luc Pattyn16-Nov-09 15:37
sitebuilderLuc Pattyn16-Nov-09 15:37 
GeneralRe: WebBrowser control without Form hosting Pin
csmanul17-Nov-09 1:28
csmanul17-Nov-09 1:28 
GeneralRe: WebBrowser control without Form hosting Pin
Luc Pattyn17-Nov-09 2:06
sitebuilderLuc Pattyn17-Nov-09 2:06 
AnswerRe: WebBrowser control without Form hosting Pin
Shameel16-Nov-09 22:54
professionalShameel16-Nov-09 22:54 
GeneralRe: WebBrowser control without Form hosting Pin
csmanul17-Nov-09 1:21
csmanul17-Nov-09 1:21 
GeneralRe: WebBrowser control without Form hosting Pin
Shameel17-Nov-09 3:19
professionalShameel17-Nov-09 3:19 
GeneralRe: WebBrowser control without Form hosting Pin
Shameel17-Nov-09 3:26
professionalShameel17-Nov-09 3:26 
QuestionGetting a console server to do more then connect Pin
bigjoe11a16-Nov-09 15:22
bigjoe11a16-Nov-09 15:22 
What II have is a small server that I been playing a round with. It's just that I can connect to it and that's about it. I been trying to do is get it so I can log and go to a menu and well doesn't look like I can get my answer from some of the other places.

So I thought I would try here. Can some one please help me set this up.
the code is below.

<br />
<br />
        static void Main(string[] args)<br />
        {<br />
            int recv;<br />
            byte[] data = new byte[1024];<br />
            IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 1605);<br />
<br />
            Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
<br />
            newsock.Bind(ipep);<br />
            newsock.Listen(10);<br />
            Console.WriteLine("Waiting for a client...");<br />
            Socket client = newsock.Accept();<br />
            IPEndPoint clientep = (IPEndPoint)client.RemoteEndPoint;<br />
            Console.WriteLine("Connected with {0} at port {1}", clientep.Address, clientep.Port);<br />
<br />
<br />
            string welcome = "Welcome to my TCP server (© 2008)";<br />
            data = Encoding.ASCII.GetBytes(welcome);<br />
            client.Send(data, data.Length, SocketFlags.None);<br />
<br />
            <br />
<br />
            do<br />
            {<br />
                string menu = "L)ogin Q)uit V)iew Log";<br />
                data = Encoding.ASCII.GetBytes(menu);<br />
                client.Send(data, data.Length, SocketFlags.None);<br />
<br />
                string choice = "Command : ";<br />
                data = Encoding.ASCII.GetBytes(choice);<br />
                client.Send(data, data.Length, SocketFlags.None);<br />
<br />
                switch (choice.ToUpper())<br />
                {<br />
                    case "Q":<br />
<br />
                        break;<br />
                    case "L":<br />
                        Login();<br />
                        break;<br />
                    case "V":<br />
                        break;<br />
<br />
                    default:<br />
                    string NotThere = "Wrong Choice";<br />
                    data = Encoding.ASCII.GetBytes(NotThere);<br />
                    client.Send(data, data.Length, SocketFlags.None);<br />
                        break;<br />
<br />
                }<br />
<br />
            } while (choice != "Q");<br />
<br />
<br />
<br />
            while (true)<br />
            {<br />
                data = new byte[1024];<br />
                recv = client.Receive(data);<br />
                if (recv == 0)<br />
                    break;<br />
<br />
                Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));<br />
                client.Send(data, recv, SocketFlags.None);<br />
            }<br />
            Console.WriteLine("Disconnected from {0}", clientep.Address);<br />
            client.Close();<br />
            newsock.Close();<br />
        }<br />
<br />
      public static void MainMenu()<br />
      {<br />
<br />
      }<br />
<br />
      public static void Login()<br />
      {<br />
<br />
      }<br />
       <br />
   }<br />

AnswerRe: Getting a console server to do more then connect Pin
ScottM116-Nov-09 19:03
ScottM116-Nov-09 19:03 
GeneralRe: Getting a console server to do more then connect Pin
bigjoe11a16-Nov-09 19:27
bigjoe11a16-Nov-09 19:27 
GeneralRe: Getting a console server to do more then connect Pin
ScottM117-Nov-09 21:54
ScottM117-Nov-09 21:54 
GeneralRe: Getting a console server to do more then connect Pin
bigjoe11a18-Nov-09 3:18
bigjoe11a18-Nov-09 3:18 
GeneralRe: Getting a console server to do more then connect Pin
ScottM118-Nov-09 3:22
ScottM118-Nov-09 3:22 
GeneralRe: Getting a console server to do more then connect Pin
bigjoe11a18-Nov-09 3:45
bigjoe11a18-Nov-09 3:45 
QuestionGet current cursor lower left position so that tooltip could be displayed properly Pin
LiYS16-Nov-09 14:41
LiYS16-Nov-09 14:41 
AnswerRe: Get current cursor lower left position so that tooltip could be displayed properly Pin
Christian Graus16-Nov-09 15:01
protectorChristian Graus16-Nov-09 15:01 
AnswerRe: Get current cursor lower left position so that tooltip could be displayed properly Pin
Luc Pattyn16-Nov-09 15:17
sitebuilderLuc Pattyn16-Nov-09 15:17 
AnswerRe: Get current cursor lower left position so that tooltip could be displayed properly Pin
LiYS16-Nov-09 18:28
LiYS16-Nov-09 18:28 
Questionstring in textbox with filter Pin
Aljaz11116-Nov-09 13:58
Aljaz11116-Nov-09 13:58 
AnswerRe: string in textbox with filter Pin
Christian Graus16-Nov-09 14:00
protectorChristian Graus16-Nov-09 14:00 
GeneralRe: string in textbox with filter Pin
Aljaz11116-Nov-09 15:16
Aljaz11116-Nov-09 15:16 
Questionget all users in a group from AD Pin
caiena16-Nov-09 10:44
caiena16-Nov-09 10:44 
AnswerRe: get all users in a group from AD Pin
RCoate16-Nov-09 11:40
RCoate16-Nov-09 11:40 
QuestionProxy class from WSDL considering known types. Pin
Member 232448316-Nov-09 9:20
Member 232448316-Nov-09 9:20 
AnswerRe: Proxy class from WSDL considering known types. Pin
Member 232448316-Nov-09 13:02
Member 232448316-Nov-09 13:02 

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.