Csharp Ninja

Csharp Ninja

  • NA
  • 97
  • 179k

Compile with /main to specify the type that contains the entry point?????

Feb 29 2012 5:28 PM
ERROR HERE: (I think this is a Main class Problem)

Error    2    Program 'c:\users\usernamex\documents\visual studio 2010\Projects\WindowsFormsApplication29-DownloadPage\WindowsFormsApplication29-DownloadPage\obj\x86\Debug\WindowsFormsApplication29-DownloadPage.exe' has more than one entry point defined: 'WindowsFormsApplication29_DownloadPage.Form1.GetPage.Main(string[])'.  Compile with /main to specify the type that contains the entry point.    c:\users\usernamex\documents\visual studio 2010\Projects\WindowsFormsApplication29-DownloadPage\WindowsFormsApplication29-DownloadPage\Form1.cs    45    25    WindowsFormsApplication29-DownloadPage


WHAT THE ************* IS THIS PROBLEM???? I CAN'T SOLVE THIS PROBLEM. HELP ME PLS

MY Form1.cs CODES:


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.Net;
using System.IO;

namespace WindowsFormsApplication29_DownloadPage
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        class GetPage
        {
            public string DownloadPage(Uri url)
            {
                WebRequest http = HttpWebRequest.Create(url);
                HttpWebResponse response = (HttpWebResponse)http.GetResponse();
                StreamReader stream = new StreamReader(response.GetResponseStream(),
                    System.Text.Encoding.ASCII);

                string result = stream.ReadToEnd();
                response.Close();
                stream.Close();
                return result;

            }

            public void Go(String page)
            {
                Uri u = new Uri(page);
                string str = DownloadPage(u);
                Console.WriteLine(str);
            }

            [STAThread]
            static void Main(string[] args)
            {
                GetPage module = new GetPage();
                String page;
                if (args.Length == 0)
                    page = "http://www.slslslslslslsl.com/pathblabla.php";
                else
                    page = args[0];
                module.Go(page);
            }

        }

    }
}

MY Program.cs CODES:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace WindowsFormsApplication29_DownloadPage
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }


    }
}

I NEED TO YOUR HELPS. THANKS

CHEERS

"NINJA"




Answers (3)