using System;
using System.IO;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
public class Form1:Form
{
int W=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;//获取屏幕宽度
int H=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;//获取屏幕高度
public Form1()
{
InitializeComponent();
this.TopMost=true;
this.FormBorderStyle =  System.Windows.Forms.FormBorderStyle.None;
this.Size=new Size(100,100);
this.BackColor=Color.BlueViolet;
}
private void InitializeComponent()
{
this.Text="form";
}
static void Main()
{
Application.Run(new Form1());
}
}
请教怎么错了????
求分析
或修改后的源码
【用的是ppc的pocketc#】
错误信息:
>> 开始编译...
\csharp\form\form.exe: no entry point specified
nment
耗时4.126秒
>> 编译失败

解决方案 »

  1.   

    static void Main()不是一般在Program.cs文件中吗。试一试修改项目属性中的Application 页的Startup object. 设置成你的Form1.
      

  2.   

    找不到入口,比如winform的入口是使用[STAThread]。
      

  3.   

    ppc的pocketc#应该和winform类似,有对应的入口标识
      

  4.   

    在main函数上加上[MTAThread]试试[MTAThread]  
    static void Main()
    {
    Application.Run(new Form1());
    }
      

  5.   

    在main函数上加上[MTAThread]试试[MTAThread]  
    static void Main()
    {
    Application.Run(new Form1());
    }

    这个:>> 开始编译...
    \csharp\fom\fom.exe: no entry point specified
    ignment
    \csharp\fom\form1.cs:22: invalid type specification `(null)' 
    \csharp\fom\form1.cs:22: `int' does not inherit from `System.Attribute'
    耗时3.207秒
    >> 编译失败
    感觉好晕
      

  6.   


    //Form1里面
     public partial class Form1 : Form
        {
            int W = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;//获取屏幕宽度
            int H = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;//获取屏幕高度        public Form1()
            {
                InitializeComponent();
                this.TopMost = true;
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                this.Size = new Size(100, 100);
                this.BackColor = Color.BlueViolet;
            }        private void Form1_Load(object sender, EventArgs e)
            {        }
        }
    //Program.cs里面
    static class Program
        {
            /// <summary>
            /// アプリケーションのメイン エントリ ポイントです。
            /// </summary>
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Form1());
            }
        }
      

  7.   

    天知道你的这个所谓的Pocket C#有没有bug。你愿意测试这种非主流的东西只能好自为之了。