日期:2014-05-17  浏览次数:20982 次

别的CS文件中的函数怎么调用?
我先写了一个cs文件,如下
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace hanshuku
{
    class hanshu
    {
        public const double pi =3.1415;
        
        public static double hu2shishu(double hu)
        {
            double jiaodu = hu * 180 / pi;
            int du = (int)jiaodu;
            double m = (jiaodu - du) * 60;
            int fen = (int)m;
            double s = Math.Round((m - fen) * 60, 2);
            string a = du.ToString();
            string b = fen.ToString();
            string c = s.ToString();
            if (b.Length == 1)
                b = "0" + b;
            int p = c.IndexOf(".");
            int n = c.Length;
            c = c.Remove(p, 1);
            string jiao = a + b + "." + c;
            jiaodu = double.Parse(jiao);
            return jiaodu;
        }
       
    }
}

然后,关掉之后,又创建了一个winform,应经添加了using了,为什么还不能用啊
代码如下
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 hanshuku;

namespace 实验子函数调用
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double hu = double.Parse(this.textBox1.Text.ToString());
  &n