初级问题:我新建了一个C# WINDOWSAPPLICATION ,新建了一个类,写了一个方法

changechange 2006-06-24 04:34:02
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Service911.CSharp
{
class clsLimitPrice
{
// 申明类内的常量
public const string MY_PXXML = "";

// 声明类内的变量
private string strAA = "";
public static void GetPrice(){
MessageBox.Show("hi!");
}

}
}




我如何让程序一启动就运行这个方法?(GetPrice)

要如何更改 PROGRAM.CS 中的 Application.Run()
...全文
155 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aSalt 2006-06-24
  • 打赏
  • 举报
回复
同意楼上
Reeezak 2006-06-24
  • 打赏
  • 举报
回复
同意楼上
LMTZ 2006-06-24
  • 打赏
  • 举报
回复
在你的Main函数中直接添加代码:

Service911.CSharp.clsLimitPrice.GetPrice();

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧