noob with does not exist in the current context error
<p>Hey guys I'm coding a rcon message tool for a game server in C#. However I've run across a error:</p>

<blockquote>
  <p>"The name 'm' does not exist in the current context"</p>
</blockquote>

<p>By now you're shouting at your screen NOOB! and yes I admit I am; I have little real coding experience.</p>

<p>I've played with MFC C++ and OpenGL and I'm a fairly respected cod modder "script is gsc loosely based on c++" so I hope I can learn quickly, basically I tried to access an instance of b. outside of the main loop but it gave me the error:</p>

<blockquote>
  <p>The name b does not exist in the current context</p>
</blockquote>

<p>so I made a new messages function that started a new connection in a new instance. Then I tried the access that in another function <code>stopmessages()</code> but I still get the error.</p>

<p>Sorry for the newb question. I've googled long and hard about this and I just don't understand.</p>

<p>Here's my code - it uses <code>Nini.dll</code> for config file access and <code>BattleNET.dll</code> for access to rcon for the game -</p>

<pre><code>#region

using System;
using System.Net;
using System.Text;
using BattleNET;
using Nini.Config;
#endregion



namespace BattleNET_client
{

internal class Program
{

   private static  void Main(string[] args)
    {
        bool isit_ok = true;

        Console.OutputEncoding = Encoding.UTF8;
        Console.Title = "rotceh_dnih's DayZ servermessages";
        BattlEyeLoginCredentials loginCredentials = GetLoginCredentials();
        Console.Title += string.Format(" - {0}:{1}", loginCredentials.Host, loginCredentials.Port);
        IBattleNET b = new BattlEyeClient(loginCredentials);
        b.MessageReceivedEvent += DumpMessage;
        b.DisconnectEvent += Disconnected;
        b.ReconnectOnPacketLoss(true);
        b.Connect();

        while (true)
        {
            startmessages();
            string cmd = Console.ReadLine();

            if (cmd == "exit" || cmd == "logout" || cmd == "quit")
            {
                Environment.Exit(0);
            }

            if (cmd == "restart")
            {
                stopmessages();
            }
            if (cmd == "startstuff")
            {
                startmessages();
            }

            if (b.IsConnected())
            {
                if (isit_ok)
                {

                }
                isit_ok = false;
                b.SendCommandPacket(cmd);
            }
            else
            {
                Console.WriteLine("Not connected!");
            }
        }
    }

    private static BattlEyeLoginCredentials GetLoginCredentials()
    {

        IConfigSource source = new IniConfigSource("server/admindets.ini");
        string serverip = source.Configs["rconlogin"].Get("ip");
        int serverport = source.Configs["rconlogin"].GetInt("port");
        string password = source.Configs["rconlogin"].Get("rconpwd");
        var loginCredentials = new BattlEyeLoginCredentials
                                   {
                                       Host = serverip,
                                       Port = serverport,
                                       Password = password,
                                   };          
        return loginCredentials;
    }

   public static void startmessages()
    {
       BattlEyeLoginCredentials loginCredentials = GetLoginCredentials();
        IBattleNET m = new BattlEyeClient(loginCredentials);
        m.MessageReceivedEvent += DumpMessage;
        m.DisconnectEvent += Disconnected;
        m.ReconnectOnPacketLoss(true);
        m.Connect();

        IConfigSource messagesource = new IniConfigSource("messages/servermessages.ini");

        int messagewait = messagesource.Configs["timesettings"].GetInt("delay");
        string[] messages = messagesource.Configs["rconmessages"].Get("messages1").Split('|');
    //    for (;;)
      //  {

            foreach (string message in messages)
            {
                Console.WriteLine(message);
                 m.SendCommandPacket(EBattlEyeCommand.Say,message);
                 System.Threading.Thread.Sleep(messagewait * 60 * 1000); 

            }
     //   }

    }


   public static void stopmessages()
   {

       m.Disconnect();
   }


    private static void Disconnected(BattlEyeDisconnectEventArgs args)
    {
        Console.WriteLine(args.Message);
    }

    private static void DumpMessage(BattlEyeMessageEventArgs args)
    {
        Console.WriteLine(args.Message);
    }
}
}
</code></pre>
