Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 476603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:30:23+00:00 2026-05-13T00:30:23+00:00

I wrote the following program that is suppose to start up, show the form

  • 0

I wrote the following program that is suppose to start up, show the form and connect to the server and get an messages. However when I start it nothing happens?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Lidgren.Network;
using System.Threading;

namespace WindowsGame2
{
    public partial class Form1 : Form
    {
        private NetClient client;
        private NetBuffer buffer;

        public Form1()
        {
            InitializeComponent();
        }

        private void Connect()
        {
            NetConfiguration config = new NetConfiguration("xesh");
            NetClient client = new NetClient(config);

            client.Connect("75.127.105.216", 14242);

            NetBuffer buffer = client.CreateBuffer();
        }

        private void ReceiveMessages()
        {
            Connect();
            bool keepGoing = true;
            while (keepGoing)
            {
                NetMessageType type;
                while (client.ReadMessage(buffer, out type))
                {
                    switch (type)
                    {
                        case NetMessageType.DebugMessage:
                            Console.WriteLine(buffer.ReadString());
                            break;

                        case NetMessageType.StatusChanged:
                            Console.WriteLine("New status: " + client.Status + " Reason: " + buffer.ReadString());
                            break;

                        case NetMessageType.Data:
                            break;
                    }
                }
            }
        }

        private void Update(string str)
        {
            ReceiveMessages();
            textBox1.AppendText(str + "\r\n");
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        static void Main(string[] args)
        {
            Form1 form = new Form1();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T00:30:23+00:00Added an answer on May 13, 2026 at 12:30 am

    You aren’t calling your methods.

    try:

    static void Main(string[] args)
    {
        Form1 form = new Form1();
        ReceiveMessages();
        // or 
        Update("Me");
    }
    

    Do you have any buttons on your form? Kinda need a bit more information

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a C++ program that takes the following inputs from
I need to write a simple program for work that does the following: read
I wrote the following program #include <iostream> template<typename C, typename Res, typename... Args> class
In Visual C++ i wrote the following sample in a C++ program: float f1
I wrote the following program in the C and when I run it, I
Suppose that one has some lock based code like the following where mutexes are
I wrote following program int main () { char a=0xf; a=a+1; printf(%c\n,a); } the
I wrote the following program to delete an array element entered by the user.
I wrote the following program in Python 2 to do Newton's method computations for
The following is part of client program for a fraction class. I wrote the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.