这个不行。不能直接饮用[Quote=引用 77 楼 的回复:]
建议做一个类 在类里设置 这样在任何的地方都可以调用 下面是一个例子
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
建议做一个类 在类里设置 这样在任何的地方都可以调用 下面是一个例子
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace _test
{
public class SqlBase //此处为类名称
{
public static string username;
public static string qx;
public static string dwmc;
public static string ip;
}
窗体调用位置里直接进行调用 如
label1.Text=SqlBase.username
label2.Text=SqlBase.dwmc