C# a Step by Step Beginners Tutorial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts

  • Escapee
    replied

    PART 2 Continued......


    The Full code is avalable at the bottom of this post

    Step 13
    So now we have 2 projects but TestForm1 still doesn't really know of the BetfairAPI projects
    existence and so we add a reference to it so that the Betfair Class can be accessed from the
    TestForm1 Project.

    In Solution Explorer, Select the TestForm1 by left Clicking on it.
    Then Right Click on TestForm1's "references" and select the "Add Reference" option.

    This will pop up the "Add Reference" form, Slect the "Projects" Tab and hopefully you will
    see the BetfairAPI project Sitting there ready for you. Select it and Click OK




    if you now expand TestForms1's references you should see BetfairAPI sitting there like this



    Step 14
    Next I want you to add a button to testForm1 called butLogOn, And also create the click event.
    I'm assuming everyone who has got this far knows how to do this.




    Step 15
    Now we can start Coding.


    in the Form1.cs file

    Add the following below the existing "using" statements

    Code:
    using System.Diagnostics;
    using BetfairAPI;
    Step 16
    Add the following within the Form1 Class

    Code:
            public CBetfairAPI MyBetfair;
            public bool bLoggedOn;
    Step 17
    Change the Form1 Constructor to look like this

    Code:
            public Form1()
            {
                InitializeComponent();
    
                MyBetfair = new CBetfairAPI();
    
                bLoggedOn = false;
            }
    Step 18
    and then add the code for the ButLogOn_Click() event

    Code:
            private void ButLogOn_Click( object sender, EventArgs e )
            {
                string uuu = "YourUserName";  // Change as required
                string ppp = "YourPassword";
    
                if( bLoggedOn == false )
                {
                    if( MyBetfair.Login( uuu, ppp ) == true )
                    {
                        bLoggedOn = true;
    
                        this.Text = "Logged On To Betfair";
    
                    }
                    else
                    {
                        this.Text = "Log on FAILED, Check Debug Messages";
    
                    }
                }
            }

    So there we have it, Compile and run in debug mode and see what happens

    If it worked then lets go on to enhancing the BetfairAPI class to add a LogOut() function

    Step 19
    Start off by Selecting the CBetfairAPI.cs file for editing in the BetfairAPI project.
    And then create the LogOut() function below the Login() function

    Code:
            public bool LogOut()
            {
                bool bRetCode;
                const string serviceName = "LogOut";
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1}", DateTime.Now, serviceName ) );
    
    
                var request = new LogoutReq();
    
                request.header = _globReqHdr;
    
                LogoutResp response = _bfGlobal.logout( request );
    
                bRetCode = CheckResponse(   serviceName,
                                            Convert.ToString( response.header.errorCode ),
                                            Convert.ToString( response.errorCode ),
                                            response.header.sessionToken );
    
                if( bRetCode == false )
                {
                    Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - FAILED", DateTime.Now, serviceName ) );
                    return false;
                }
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - OK", DateTime.Now, serviceName ) );
    
                return true;
    
            }

    If you look closely and compare the Login() and LogOut() function you will see they are almost
    exactly the same and follow the same format. The only major difference is that login() doesn't
    require a 'Request Header' i.e. no session token, currency etc. where as all the other calls do,
    and therefore in Logout() ( and all the other calls yet to be created) A request Header is assigned
    the global ( or Exchange ) header which already contains a valid session token by:
    "request.header = _globReqHdr;"

    This 'Same Format' for each call is a good theme to maintain for almost every call to betfair. It does change a little for getting prices or placing bets but not much.
    Keeping to similar formats enables quick intuitive programming which becomes easier to read, use, understand and maintain.

    Step 20
    Now go back and ammend the ButLogOn_Click() event code in TestForm1

    Code:
            private void ButLogOn_Click( object sender, EventArgs e )
            {
                string uuu = "YourUserName";
                string ppp = "YourPassword"; 
    
                if( bLoggedOn == false )
                {
                    if( MyBetfair.Login( uuu, ppp ) == true )
                    {
                        bLoggedOn = true;
    
                        ButLogOn.Text = "Log Out";
                        this.Text = "Logged On To Betfair";
    
                    }
                    else
                    {
                        this.Text = "Log on FAILED, Check Debug Messages";
    
                    }
                }
                else
                {
                    if( MyBetfair.LogOut() == true )
                    {
                        bLoggedOn = false;
    
                        ButLogOn.Text = "Log On";
                        this.Text = "NOT Logged On To Betfair";
    
                    }
                    else
                    {
                        this.Text = "Log Out FAILED, Check Debug Messages";
    
                    }
                }
            }

    Compile, then run in debug mode, you will be able to log in and out of betfair to your
    hearts content



    Below is the Full Code For:

    CBetfairAPI
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    
    using System.Diagnostics;
    
    using BetfairAPI.BFGlobal;
    using BetfairAPI.BFExchange;
    
    namespace BetfairAPI
    {
        public class CBetfairAPI
        {
    
            #region Variables
    
            private BFGlobalService _bfGlobal;
            private BFExchangeService _bfExchange;
    
            private BFGlobal.APIRequestHeader _globReqHdr;
            private BFExchange.APIRequestHeader _exchReqHdr;
    
            private string _username;
            private string _password;
            private int _productId;
            private int _vendorSoftwareId;
            private string _sessionToken;
    
            private string _currency;
    
    
    
    
            #endregion
    
            #region Constuctor
    
            public  CBetfairAPI()
            {
                Debug.WriteLine( string.Format( "{0} - Initializing CBetfairAPI", DateTime.Now ) );
    
                _bfGlobal = new BFGlobalService();
    
                _bfGlobal.EnableDecompression = true;
    
                _bfExchange = new BFExchangeService();
    
                _bfExchange.EnableDecompression = true;
    
    
                _globReqHdr = new BFGlobal.APIRequestHeader();
                _exchReqHdr = new BFExchange.APIRequestHeader();
    
    
                _username = "";
                _password = "";
    
                _sessionToken = "";
    
                _productId = 82;
                _vendorSoftwareId = 0;
    
                _currency = "";
            }
    
            #endregion
    
    
    
            public bool Login( string UserName, string PassWord  )
            {
                bool bRetCode;
                const string serviceName = "Login";
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1}", DateTime.Now, serviceName ) );
    
                _username = UserName;
                _password = PassWord;
    
    
                var request = new LoginReq {    username = _username, 
                                                password = _password, 
                                                productId = _productId, 
                                                vendorSoftwareId = _vendorSoftwareId };
    
                LoginResp response = _bfGlobal.login( request );
    
                bRetCode = CheckResponse(   serviceName, 
                                            Convert.ToString( response.header.errorCode ),
                                            Convert.ToString( response.errorCode ), 
                                            response.header.sessionToken );
                if( bRetCode == false )
                {
                    Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - FAILED", DateTime.Now, serviceName ) );
                    return false;
                }
    
                _currency = response.currency;
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - OK", DateTime.Now, serviceName ) );
    
                return true;
            }
    
            public bool LogOut()
            {
                bool bRetCode;
                const string serviceName = "LogOut";
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1}", DateTime.Now, serviceName ) );
    
    
                var request = new LogoutReq();
    
                request.header = _globReqHdr;
    
                LogoutResp response = _bfGlobal.logout( request );
    
                bRetCode = CheckResponse(   serviceName,
                                            Convert.ToString( response.header.errorCode ),
                                            Convert.ToString( response.errorCode ),
                                            response.header.sessionToken );
    
                if( bRetCode == false )
                {
                    Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - FAILED", DateTime.Now, serviceName ) );
                    return false;
                }
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - OK", DateTime.Now, serviceName ) );
    
                return true;
    
            }
    
    
    
            private bool CheckResponse( string serviceName, string hdrErrCd, string respErrCd, string sessionToken )
            {
    
                if( ! string.IsNullOrEmpty( sessionToken ) )
                {
                    _sessionToken = sessionToken;
                    _globReqHdr.sessionToken = sessionToken;
                    _exchReqHdr.sessionToken = sessionToken;
                }
    
                if( hdrErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.Header.ErrorCode = {1}", serviceName, hdrErrCd ) );
                    return ( false );
                }
                if( respErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.ErrorCode = {1}", serviceName, respErrCd ) );
                    return ( false );
                }
    
                return ( true );
            }
    
    
            
    
        }
    }

    Form1.cs
    Code:
    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 System.Diagnostics;
    using BetfairAPI;
    
    namespace TestForm1
    {
        public partial class Form1 : Form
        {
            public CBetfairAPI MyBetfair;
            public bool bLoggedOn;
    
            public Form1()
            {
                InitializeComponent();
    
                MyBetfair = new CBetfairAPI();
    
                bLoggedOn = false;
            }
    
            private void ButLogOn_Click( object sender, EventArgs e )
            {
                string uuu = "YourUserName";
                string ppp = "YourPassword"; 
    
    
                if( bLoggedOn == false )
                {
                    if( MyBetfair.Login( uuu, ppp ) == true )
                    {
                        bLoggedOn = true;
    
                        ButLogOn.Text = "Log Out";
                        this.Text = "Logged On To Betfair";
    
                    }
                    else
                    {
                        this.Text = "Log on FAILED, Check Debug Messages";
    
                    }
                }
                else
                {
                    if( MyBetfair.LogOut() == true )
                    {
                        bLoggedOn = false;
    
                        ButLogOn.Text = "Log On";
                        this.Text = "NOT Logged On To Betfair";
    
                    }
                    else
                    {
                        this.Text = "Log Out FAILED, Check Debug Messages";
    
                    }
                }
            }
        }
    }
    Last edited by Escapee; 30-05-2012, 11:11 AM.

    Leave a comment:


  • Escapee
    replied

    PART 2

    The GUI, Demonstrating how to use the Betfair Class

    In part 2 we build a simple gui which accesses the class/.dll we created in part 1

    Obviously this will start off very simple and only perform a login, but If enough
    interest is shown then I will extend the tutorial to creating a fully fledged
    GUI the will look and feel pretty much like the Betfair website.


    I'm using Visual Studio 2008 professional, Other versions might look different
    according to the personal setup but it should be close enough to be achieved
    on any version above 2003.

    First off, close the part one project in Visual studio if you still have it open.
    we want to start from a clean sheet to show how the two projects are stand alone
    but also linked together.

    Step 11

    Right, Create a new "Windows Forms Application" project called TestForm1 or something.

    Change the Location to the "My Betfair" folder you created in Part 1



    After creating the TestForm1 project you should be a bit like this




    Step 12
    Now we are going to add our existing BetFairAPI project from part 1 to this TestForm1 project.
    Which turns our "TestForm1" project into what Microsoft call a "solution". i.e. a solution is
    comprised of one or more projects.
    This is an extremely useful way of organising things as it allows us to make enhancements to
    the core CBetfairAPI project which are then available to all the other projects that use it.
    So we only need to write the Betfair Access stuff once and reuse it for ever.

    from the "File" menu, select "ADD", then Select Existing Project.
    ( in the future I will notate menu navigation as "File->Add->Existing Project" )
    This will pop up the Add Existing Projects form which you should navigate all the way to
    the BetfairAPI project folder and then select the "BetfairAPI.csproj" file like this



    Our TestForm1 Solution Explorer should now look a bit like this



    Part 2 is continued next post
    Last edited by Escapee; 30-05-2012, 11:06 AM.

    Leave a comment:


  • Escapee
    replied
    PART 1 CONTINUED

    ( code formatting is a bit messy but there is the complete code at the bottom of the post )


    Step 4
    Now we are going to add the web references, This is the bit that auto generates the background
    code that actually talks to betfair



    In the Solution Explorer, right click on "References" and select "Add Service Reference"
    from the pop up menu. This pops up a form

    Click the "Advanced" button, this pops up another form.

    Click the "Add Web Reference" button, this pops up yet another form.

    ( Note in some versions of Visual studio, the "add web reference" option is accessed
    from the initial pop up menu )


    In the pop up form, enter the following in the "URL:" section

    https://api.betfair.com/global/v3/BFGlobalService.wsdl

    Hit the "Go" buttion and it should find the GLOBAL webservice.
    Note 1: I sometimes find this process a bit flakey so try it a couple of
    times if it fails with an error.
    Note 2: depending on your security settings it can cause a load of pop ups
    asking if you only want "secure" content. I Always select the "No, I want it all"
    option and don't know the outcome of not doing this but I suspect it won't
    work 100%.

    Next we need to change the "Web reference name" part to something meaningful
    so navigate to it and change it to "BFGlobal".



    Cick "Add Reference" BUTTON , Visual Studio will think for a bit whilst it crunches the numbers
    and if it all works well then in a new entry called "BFGlobal" should appear
    under Web References in the Solution Explorer

    Step 5
    For reasons I won't go into, Betfair spilt its WSDL into 2 services, "Global"
    and "Exchange" so now we have to repeat the process for the "Exchange" service

    In the Solution Explorer, we can now right click on "Web References" and select "Add Web Reference"
    directly from the pop up menu. This pops up the "add web reference" form


    In the pop up form, enter the following in the "URL:" section

    https://api.betfair.com/exchange/v5/...geService.wsdl


    Hit the "Go" buttion and it should find the EXCHANGE webservice.

    Next we need to change the "Web reference name" part to something meaningful
    so navigate to it and change it to "BFExchange".


    Cick "Add Reference" BUTTON and after its finished the "Solution Explorer" should
    look like this





    At this point we have the bare skelton for accessing betfair, but its not much use as it
    stands so we have to flesh it out a bit. We have to create what is called the "wrapper" class
    which is what makes it easy for anything else we might build in the future to access betfair.
    All any new project should have to do is know how to talk to the wrapper and it couldn't care less about the
    skeleton bits behind the scenes.
    Our wrapper class is called "CBetfairAPI" which we created earlier in the project, so now we add
    the code in here which creates the flesh arround the skelton.


    Step 6
    At the top of the CBetfairAPI.cs file, Below the existing "using" statements, add the following code:

    Code:
    using System.Diagnostics;
    
    using BetfairAPI.BFGlobal;
    using BetfairAPI.BFExchange;
    This will enable us to put out debug trace messages and also
    Tells our wrapper about the "Global" and "Exchange" skeleton classes.

    Do a quick compile at this point to check its all OK so far.

    Step 7
    Next we're going to create a load of private variables and a constructor for the class.
    Naming conventions come and go but I use the underscore as a prefix to all private variables
    as I find it a useful aid-de-memoir

    within the public class CBetfairAPI
    {
    }
    code add the following..... ( Or copy the entire code from the code box provided below )

    Code:
            #region Variables
    
            private BFGlobalService _bfGlobal;
            private BFExchangeService _bfExchange;
    
            private BFGlobal.APIRequestHeader _globReqHdr;
            private BFExchange.APIRequestHeader _exchReqHdr;
    
            private string _username;
            private string _password;
            private int _productId;
            private int _vendorSoftwareId;
            private string _sessionToken;
    
            private string _currency;
    
            #endregion


    Step 8
    The Constructor is automatically called everytime a new instance of CBetfairAPI is created
    so we use this to initialise the variables

    Code:
            #region Constuctor
    
            public  CBetfairAPI()
            {
                Debug.WriteLine( string.Format( "{0} - Initializing CBetfairAPI", DateTime.Now ) );
    
                _bfGlobal = new BFGlobalService();
    
                _bfGlobal.EnableDecompression = true;
    
                _bfExchange = new BFExchangeService();
    
                _bfExchange.EnableDecompression = true;
    
    
                _globReqHdr = new BFGlobal.APIRequestHeader();
                _exchReqHdr = new BFExchange.APIRequestHeader();
    
    
                _username = "";
                _password = "";
    
                _sessionToken = "";
    
                _productId = 82;
                _vendorSoftwareId = 0;
    
                _currency = "";
            }
    
            #endregion
    Step 9
    Now create a "Login" function as below

    Code:
            public bool Login( string UserName, string PassWord  )
            {
                bool bRetCode;
                const string serviceName = "Login";
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1}", DateTime.Now, serviceName ) );
    
                _username = UserName;
                _password = PassWord;
    
    
                var request = new LoginReq {    username = _username, 
                                                password = _password, 
                                                productId = _productId, 
                                                vendorSoftwareId = _vendorSoftwareId };
    
                LoginResp response = _bfGlobal.login( request );
    
                bRetCode = CheckResponse(   serviceName, 
                                            Convert.ToString( response.header.errorCode ),
                                            Convert.ToString( response.errorCode ), 
                                            response.header.sessionToken );
                if( bRetCode == false )
                {
                    Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - FAILED", DateTime.Now, serviceName ) );
                    return false;
                }
    
                _currency = response.currency;
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - OK", DateTime.Now, serviceName ) );
    
                return true;
            }
    Step 10
    And finally some basic checking of the response to see what happened.

    Code:
            private bool CheckResponse( string serviceName, string hdrErrCd, string respErrCd, string sessionToken )
            {
    
                if( ! string.IsNullOrEmpty( sessionToken ) )
                {
                    _sessionToken = sessionToken;
                    _globReqHdr.sessionToken = sessionToken;
                    _exchReqHdr.sessionToken = sessionToken;
                }
    
                if( hdrErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.Header.ErrorCode = {1}", serviceName, hdrErrCd ) );
                    return ( false );
                }
                if( respErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.ErrorCode = {1}", serviceName, respErrCd ) );
                    return ( false );
                }
    
                return ( true );
            }



    And There you have it, in 10 easy steps you have created a basic Betfair Wrapper Class which can be accessed from any and
    all your betfair projects.

    In part 2 of this tutorial I will take you through the steps needed to use this wrapper in a gui form,

    Below is the complete code for CBetfairAPI if you want to copy and paste instead of typing it all out.


    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    
    using System.Diagnostics;
    
    using BetfairAPI.BFGlobal;
    using BetfairAPI.BFExchange;
    
    namespace BetfairAPI
    {
        public class CBetfairAPI
        {
    
            #region Variables
    
            private BFGlobalService _bfGlobal;
            private BFExchangeService _bfExchange;
    
            private BFGlobal.APIRequestHeader _globReqHdr;
            private BFExchange.APIRequestHeader _exchReqHdr;
    
            private string _username;
            private string _password;
            private int _productId;
            private int _vendorSoftwareId;
            private string _sessionToken;
    
            private string _currency;
    
    
    
    
            #endregion
    
            #region Constuctor
    
            public  CBetfairAPI()
            {
                Debug.WriteLine( string.Format( "{0} - Initializing CBetfairAPI", DateTime.Now ) );
    
                _bfGlobal = new BFGlobalService();
    
                _bfGlobal.EnableDecompression = true;
    
                _bfExchange = new BFExchangeService();
    
                _bfExchange.EnableDecompression = true;
    
    
                _globReqHdr = new BFGlobal.APIRequestHeader();
                _exchReqHdr = new BFExchange.APIRequestHeader();
    
    
                _username = "";
                _password = "";
    
                _sessionToken = "";
    
                _productId = 82;
                _vendorSoftwareId = 0;
    
                _currency = "";
            }
    
            #endregion
    
    
    
            public bool Login( string UserName, string PassWord  )
            {
                bool bRetCode;
                const string serviceName = "Login";
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1}", DateTime.Now, serviceName ) );
    
                _username = UserName;
                _password = PassWord;
    
    
                var request = new LoginReq {    username = _username, 
                                                password = _password, 
                                                productId = _productId, 
                                                vendorSoftwareId = _vendorSoftwareId };
    
                LoginResp response = _bfGlobal.login( request );
    
                bRetCode = CheckResponse(   serviceName, 
                                            Convert.ToString( response.header.errorCode ),
                                            Convert.ToString( response.errorCode ), 
                                            response.header.sessionToken );
                if( bRetCode == false )
                {
                    Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - FAILED", DateTime.Now, serviceName ) );
                    return false;
                }
    
                _currency = response.currency;
    
                Debug.WriteLine( string.Format( "{0} - CBetfairAPI - {1} - OK", DateTime.Now, serviceName ) );
    
                return true;
            }
    
    
    
    
    
            private bool CheckResponse( string serviceName, string hdrErrCd, string respErrCd, string sessionToken )
            {
    
                if( ! string.IsNullOrEmpty( sessionToken ) )
                {
                    _sessionToken = sessionToken;
                    _globReqHdr.sessionToken = sessionToken;
                    _exchReqHdr.sessionToken = sessionToken;
                }
    
                if( hdrErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.Header.ErrorCode = {1}", serviceName, hdrErrCd ) );
                    return ( false );
                }
                if( respErrCd != "OK" )
                {
                    Debug.WriteLine( string.Format( "{0} - FAILED: Response.ErrorCode = {1}", serviceName, respErrCd ) );
                    return ( false );
                }
    
                return ( true );
            }
    
    
            
    
        }
    }
    Last edited by Escapee; 22-07-2012, 01:31 PM.

    Leave a comment:


  • Escapee
    started a topic C# a Step by Step Beginners Tutorial

    C# a Step by Step Beginners Tutorial

    When I first started writing programs for betfair, I had a hard time of it,
    I'd never written for the PC ( only UNIX and some dinosaurs from the 50's 60's and 80's )

    with a decade old compiler and no PC knowledge at all it took me about 4 months to
    get a simple Login() function to work.

    Now it can be done in an afternoon with practically zero PC knowledge, just a smattering of C#
    and a copy of Visual Studio.

    In the background there's the pinicle of 50 years of development technology with things like
    XML, WDSL, SOAP & DLL's but as a beginner, you'll likely die of a Bill Gates induced migrane
    before mastering all that and actually writing a small program.

    This tutorial is intended to allow you to skip straight into to world of point and click
    having just a little bit of grounding in C# or similar.


    So here we have a step by step tutorial where only a basic knowledge of C# is assumed.

    Parts 1 and 2 create a general purpose reusable class for talking to betfair with just
    the basics of logging in and out. followed by a simple form demonstarting how to use this
    class.

    If there's enough interest and I find the time, I could take this all the way to a fully
    functioning GUI that behaves pretty much as the standard web interface we all know and love so much !


    I'm using VS2008 professional but other versions hopefully don't differ enough to make this incomprehensible.
    You can obtain a free 'lite' version of C# called "C# Express" ( or something like that ) downloadable from www.microsoft.com

    Edit: The tutorial is now goes upto Part 7 in 85 steps and if you complete it you will have this:


    PART 1
    The Betfair Class

    Step 1
    First off we want to setup a bit of organisation so Create a folder in your \Users\XXXX\Documents\Visual Studio 2008\Projects\
    folder called "My Betfair" ( or whatever name you desire, in this tutorial its called "My Tutorial" )

    Step 2
    Now in Visual Studio Create a new c# 'Class Library' Project ( Class Library = .dll ) called BetfairAPI
    Located in your "My Betfair" folder like so:



    After you've filled in the relevant parts of the form and clicked OK it should create our
    BetfairAPI project Like this



    Step 3
    The default name for the class it has created is "Class1" we want to change this to something
    more meaningful so:
    Right click on the 'class1.cs' file in the Solution explorer
    Select 'Rename' from the popup menu
    Change the name to "CBetfairAPI.cs"
    when you press enter, a pop up message box will appear asking if you
    want to rename the class as well. Select Yes

    Now the project should look like this




    This forum only allows 4 images per post so continued in Netx post
    Last edited by Escapee; 22-07-2012, 01:37 PM.
Working...
X