TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Csharp Ninja
NA
97
179.2k
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"
Reply
Answers (
3
)
Finalize part 2
Finalize part : hopfully last