相关疑难解决方法(0)

"不包含适用于入口点的静态'主'方法"

我无法想象下面我的代码有什么问题.

当我尝试编译时,我收到消息:

不包含适用于入口点的静态"主"方法.

这是我的代码:

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;

namespace RandomNumberGenerator
{

public partial class Form1 : Form
{
    private const int rangeNumberMin = 1;
    private const int rangeNumberMax = 3;
    private int randomNumber;

public Form1()
{            
        randomNumber = GenerateNumber(rangeNumberMin, rangeNumberMax);
}

private int GenerateNumber(int min,int max)
    {
        Random random = new Random();
        return random.Next(min, max);
    }

private void Display(object sender, EventArgs e)
    {                       
        switch (randomNumber)
        {
            case 1: …
Run Code Online (Sandbox Code Playgroud)

c# program-entry-point entry-point

9
推荐指数
3
解决办法
6万
查看次数

CS5001:exe不包含适用于入口点的静态"Main"方法

using System;

public class Newton_Ralphson
{
    public double compute(double x,int n,double[] P)            // x, degree, coefficients 
    {
        double pol = 0;
        for (int i = 0;i < n;i++)
        {
            for (int j = 1; j < n - i; j++)
                x *= x;
                pol += P[n - i] * x;
        }
        pol += P[0];
        return pol;
    }

public double[] secondary_Pol(int n, double[] P)            //slope
{
    double[] secP = new double[n - 1];
    for (int i = 0; i < n …
Run Code Online (Sandbox Code Playgroud)

c#

6
推荐指数
1
解决办法
6万
查看次数

标签 统计

c# ×2

entry-point ×1

program-entry-point ×1