威尼斯www.9778.com-威尼斯正版官方网站

C# 操作注册表

日期:2020-01-04编辑作者:编程人生

语言c# ,运行需要 .Net Framework 2.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;
using System.Management;
using System.Security.Cryptography;
using System.Net;
using System.Net.NetworkInformation;
using System.Text.RegularExpressions;

     在软件开发中,为了对计算机或者相关的权限作设置,我们需要对注册表进行操作,比如最近刚刚完成了一个项目需要限制用户的使用--试用版,c/s架构的,这个是b/s的还不一样,如果是b/s的直接加个时间锁就可以了,因为获取的是服务器端的时间,用户不可能去改服务器的时间,但是c/s的就不一样了,时间都是客户端的,修改了自己的机器的时间,照样又可以继续使用,所以不可取,这个时候我们就可以对计算机的注册表进行操作,为了防止用户修改注册表,可以对写入的键值进行加密,当然了,这些都是相对的,有人会说,如果重新安装系统,不是又可以使用,呵呵,如果每次都要装系统,也划不来,这里不讨论这个,肯定会有好的方法解决,在这里说下,C#对注册表的操作:

在很多行业或公司,会通过限制ip的方法,使局域网内一部分ip可以上外网。本方案通过修改ip和网卡地址达到在别人不知不觉地情况下共用一个ip上网。
==================代码如下: =======================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Windows;
using System.Management;
using System.Net.NetworkInformation;
using System.ServiceProcess;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{

   首先,看下注册表的结构

namespace ReworkMAC
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

public Form1()
{
InitializeComponent();
}

    图片 1 

        private void Form1_Load(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            RegistryKey macRegistry = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Control").OpenSubKey("Class").OpenSubKey("{4D36E972-E325-11CE-BFC1-08002bE10318}");//mac的注册表建所在
            foreach (string mrk in macRegistry.GetSubKeyNames())
            {
                listBox1.Items.Add(mrk);
            }
            IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
           
            textBox4.Text = computerProperties.HostName;
            NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface adapter in nics)
            {
                if (adapter.Name=="本地连接")
                {
                    textBox2.Text = adapter.Description;
                    textBox3.Text = adapter.GetPhysicalAddress().ToString();
                    textBox10.Text = adapter.Id;
                }
        //        listBox3.Items.Add(adapter.Id+" 接口类型  "+adapter.NetworkInterfaceType.ToString());
            }
            /////////////////////////////////////////////////////////////////
            ///一下这一段有待以后研究,现在还没有看懂
            ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection moc = mc.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                if (!(bool)mo["IPEnabled"])
                    continue;
                string[] addresses = (string[])mo["IPAddress"];
                string[] subnets = (string[])mo["IPSubnet"];
                foreach (string sad in addresses)
                    textBox7.Text = sad;
                foreach (string sub in subnets)
                    textBox8.Text = sub;
            }
            //////////////////////////////////////////////////////////////
         //   checkBox2.
        }
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                listBox2.Items.Clear();
                RegistryKey thisKey = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Control").OpenSubKey("Class").OpenSubKey("{4D36E972-E325-11CE-BFC1-08002bE10318}").OpenSubKey(listBox1.SelectedItem.ToString());
                foreach (string thisValueName in thisKey.GetValueNames())
                {
                    listBox2.Items.Add(thisValueName + "    该子键的值: " + thisKey.GetValue(thisValueName));
                }
                if (thisKey.GetValue("DriverDesc") != null)
                {
                    textBox1.Text = thisKey.GetValue("DriverDesc").ToString();
                }
                else
                {
                    textBox1.Text = "此主建下没有DriverDesc项";
                }
                button1.Text = "更改mac及ip(注意:更改之前请自己备份相关数据)";
                checkBox1.BackColor = this.BackColor;
                button1.BackColor = Color.Transparent;
                label5.BackColor = this.label1.BackColor;
            }
        }

 

   以节点的方式展现出来,所以我们在操作的时候,要先获得节点结构,然后在对其创建还是删除,修改等

        private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
        {

private void button1_Click(object sender, EventArgs e)
{

   看看实现的代码:

        }

}
string txtIP="";
string txtSubMark="";
string txtGateWay="";
private void Form1_Load(object sender, EventArgs e)
{
//cpuid
string str = string.Empty;
ManagementClass mcCpu = new ManagementClass("win32_Processor");
ManagementObjectCollection mocCpu = mcCpu.GetInstances();
foreach (ManagementObject m in mocCpu)
{
str = m["Processorid"].ToString().Trim().Substring(0, 8);//BFEBFBFF00000F65
}
//MD5加密
byte[] result = Encoding.Default.GetBytes(str);
MD5 md5 = new MD5CryptoServiceProvider();
byte[] output = md5.ComputeHash(result);
this.textBox1.Text = BitConverter.ToString(output).Replace("-", "");

   首先引入库using Microsoft.Win32;

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                string _item = "";
                foreach (string thisItem in listBox1.Items)
                {

//获取网卡ID
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");

   然后打开节点,创建节点

                    //listBox2.Items.Add(thisValueName + "    value:" + thisKey.GetValue(thisValueName));
                    RegistryKey thisKey = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Control").OpenSubKey("Class").OpenSubKey("{4D36E972-E325-11CE-BFC1-08002bE10318}");
                    if (thisKey.OpenSubKey(thisItem).GetValue("NetCfgInstanceId") != null && thisKey.OpenSubKey(thisItem).GetValue("NetCfgInstanceId").ToString() == textBox10.Text)//
                    {
                        _item = thisItem;
                    }
                }
                listBox1.SelectedItem = _item;
                button1.Text = "更改mac及ip(注意:更改之前请自己备份相关数据)";
                checkBox1.BackColor =this.BackColor;
                button1.BackColor = Color.Transparent;
                label5.BackColor = this.label1.BackColor;
            }
            else
            {
                listBox1.ClearSelected();
                listBox2.Items.Clear();
                textBox1.Text = "你还没有选择主键.";
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
           
            if (listBox1.SelectedItem != null && textBox5.Text!=null)//把mac写入注册表
            {
                RegistryKey thisKey = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Control").OpenSubKey("Class").OpenSubKey("{4D36E972-E325-11CE-BFC1-08002bE10318}").OpenSubKey(listBox1.SelectedItem.ToString(), true);
                if (thisKey.GetValue("NetworkAddress") == null)
                {
                    thisKey.SetValue("NetworkAddress", (Object)textBox5.Text);
                    thisKey.OpenSubKey("Ndi", true).OpenSubKey("params", true).OpenSubKey("NetworkAddress", true).SetValue("Default", (Object)textBox5.Text);
                    thisKey.OpenSubKey("Ndi", true).OpenSubKey("params", true).OpenSubKey("NetworkAddress", true).SetValue("ParamDesc", "Network Address");
                }
                else
                {
                    thisKey.SetValue("NetworkAddress", (Object)textBox5.Text);
                    thisKey.OpenSubKey("Ndi", true).OpenSubKey("params", true).OpenSubKey("NetworkAddress", true).SetValue("Default", (Object)textBox5.Text);
                    thisKey.OpenSubKey("Ndi", true).OpenSubKey("params", true).OpenSubKey("NetworkAddress", true).SetValue("ParamDesc", "Network Address");
                }
                if (thisKey.GetValue("NetworkAddress").ToString() == textBox5.Text)
                {
                    checkBox3.Visible=true;
                    checkBox3.Text="修改成功!";
                    checkBox3.Checked=true;
                }
                else
                {
                    checkBox3.Visible = true;
                    checkBox3.Text = "修改失败!";
                    checkBox3.Checked = false;
                    checkBox3.BackColor = Color.Red;
                    return;
                }
            }
            else
            {
                if (textBox5.Text == "")
                {
                    textBox5.Text = "请在此处输入mac地址";
                }
                button1.Text = "请选择网卡所对应的主键!";
                checkBox1.BackColor = Color.LightBlue;
                button1.BackColor = Color.LightBlue;
                label5.BackColor = Color.LightBlue;
            }
            /////////////////////////////////修改ip   
            if (textBox6.Text != "")
            {
                RegistryKey ipKey = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Services");
                ipKey.OpenSubKey("Tcpip").OpenSubKey("Parameters").OpenSubKey("Interfaces").OpenSubKey(textBox10.Text, true).SetValue("IPAddress", new string[] { textBox6.Text }, RegistryValueKind.MultiString);//注意此处RegistryValueKind.MultiString的用法
 /////////////////////////////////////////////验证
                if (ipKey.OpenSubKey("Tcpip").OpenSubKey("Parameters").OpenSubKey("Interfaces").OpenSubKey(textBox10.Text, true).GetValue("IPAddress").ToString() == textBox6.Text)
                {
                    checkBox4.Visible = true;
                    checkBox4.Text = "修改成功!";
                    checkBox4.Checked = true;
                }
                else
                {
                    checkBox4.Visible = true;
                    checkBox4.Text = "修改失败!";
                    checkBox4.Checked = false;
                    checkBox4.BackColor = Color.Red;
                    return;
                }
            }
            else
            {
                textBox6.Text = "请在此处输入ip地址";
            }
            ///////////////////////////////////////
            if (checkBox3.Checked && checkBox4.Checked)
            {
                label13.Visible = true;
                label13.Text = "请手动重启一下“本地连接”,就可以了";
            }              
        }
        static void SwitchToStatic(string ipString,string subnetString)//修改ip和子网掩码
        {
            ManagementBaseObject inPar = null;
            ManagementBaseObject outPar = null;
            ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection moc = mc.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                if (!(bool)mo["IPEnabled"])
                    continue;

ManagementObjectCollection moc2 = mc.GetInstances();

        RegistryKey regist = Registry.LocalMachine;
        RegistryKey software = regist.OpenSubKey("software", true);

                inPar = mo.GetMethodParameters("EnableStatic");
                inPar["IPAddress"] = new string[] { ipString };
                inPar["SubnetMask"] = new string[] { subnetString };
                outPar = mo.InvokeMethod("EnableStatic", inPar, null);
                break;
            }
        }
        static void ReportIP()
        {
            ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection moc = mc.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                if (!(bool)mo["IPEnabled"])
                    continue;

ManagementBaseObject inPar = null;
foreach (ManagementObject mo in moc2)
{

  然后就可以创建键值

                Console.WriteLine("{0}n   SVC:   '{1}'   MAC:   [{2}]", (string)mo["Caption"],
                  (string)mo["ServiceName"], (string)mo["MACAddress"]);

if ((bool)mo["IPEnabled"] == true)

            //注册信息写进注册表
                string myID = "insertID";
                if ((string)testCountKey.GetValue(myID, "no") == "no")//指定的键不存在
                {
                    testCountKey.SetValue(myID, "noInstID");
                }
                string myKey = "insertCount";
                if (testCountKey.GetValue(myKey, "no").ToString() == "no")//指定的键不存在
                {
                    testCountKey.SetValue(myKey, getDiskID.Encrypt("1"));
                }

                string[] addresses = (string[])mo["IPAddress"];
                string[] subnets = (string[])mo["IPSubnet"];

textBox2.Text = mo["MacAddress"].ToString();
mo.Dispose();

   现在看看一个例子,试用版使用限制,到注册成正式产品的程序

                Console.WriteLine("   Addresses   :");
                foreach (string sad in addresses)
                    Console.WriteLine("t'{0}'", sad);

}

   首先,先对注册表操作,创建节点和键值

                Console.WriteLine("   Subnets   :");
                foreach (string sub in subnets)
                    Console.WriteLine("t'{0}'", sub);
            }
        }

//获取首选dns
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in nics)
{
bool Pd1 = (adapter.NetworkInterfaceType == NetworkInterfaceType.Ethernet); //判断是否是以太网连接
if (Pd1)
{
IPInterfaceProperties ip = adapter.GetIPProperties(); //IP配置信息
if (ip.UnicastAddresses.Count > 0)
{
txtIP = ip.UnicastAddresses[0].Address.ToString();//IP地址
txtSubMark = ip.UnicastAddresses[0].IPv4Mask.ToString();//子网掩码

 

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked == true)
            {
                textBox9.Text = textBox8.Text;
                textBox9.ReadOnly = true;
            }
            else
            {
                textBox9.Clear();
                textBox9.ReadOnly = false;
            }
        }

}
if (ip.GatewayAddresses.Count > 0)
{
txtGateWay = ip.GatewayAddresses[0].Address.ToString();//默认网关
}
int DnsCount = ip.DnsAddresses.Count;
textBox3.Text = ip.DnsAddresses[0].ToString();
textBox4.Text = ip.DnsAddresses[1].ToString();
}
}
}
}
}

 static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //把登录次数写入注册表
            try
            {
                GetDiskID getDiskID = new GetDiskID();
                RegistryKey regist = Registry.LocalMachine;
                RegistryKey software = regist.OpenSubKey("software", true);
                RegistryKey testCountKey = software.CreateSubKey("aaaaaa");
                //注册信息写进注册表
                string myID = "insertID";
                if ((string)testCountKey.GetValue(myID, "no") == "no")//指定的键不存在 
                {
                    testCountKey.SetValue(myID, "noInstID");
                }
                string myKey = "insertCount";
                if (testCountKey.GetValue(myKey, "no").ToString() == "no")//指定的键不存在 
                {
                    testCountKey.SetValue(myKey, getDiskID.Encrypt("1"));
                }
                else
                {
                    
                    string diskID = getDiskID.GetHardDiskID();
                    string list = getDiskID.RegisteNum(diskID);
                    string  insID = testCountKey.GetValue("insertID").ToString();
                  //  string count = getDiskID.Encrypt("100");
                    //如果已经注册,则不需要添加
                    if (list!=insID)
                    {
                    int testCount = Convert.ToInt32(getDiskID.Decrypt(testCountKey.GetValue(myKey).ToString()));
                    testCount += 1;
                    testCountKey.SetValue(myKey, getDiskID.Encrypt(testCount.ToString()));
                    }
                }

        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox6.Text != "" && textBox9.Text != "")
            {
                SwitchToStatic(textBox6.Text, textBox9.Text);
            }
            else
            {
                if (textBox6.Text == "")
                {
                    textBox6.Text = "请在此处输入ip地址";
                }
                if (textBox9.Text == "")
                {
                    textBox9.Text = "请在此处输入子网掩码";
                }
            }
        }

            
                regist.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("注册表项设置失败!");
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MainForm f1 = new MainForm();
            Application.Run(f1);
        }
    }
}

         private void button4_Click(object sender, EventArgs e)
        {
                button4.Text = "暂时不提供本功能!";
        }
        private void textBox5_Click(object sender, EventArgs e)
        {
            if (textBox5.Text == "请在此处输入mac地址")
            textBox5.Clear();
        }
        private void textBox6_Click(object sender, EventArgs e)
        {
            if (textBox6.Text == "请在此处输入ip地址")
                textBox6.Clear();
        }
        private void textBox9_Click(object sender, EventArgs e)
        {
            if (textBox9.Text == "请在此处输入子网掩码")
                textBox9.Clear();
        }

然后,打开窗体的时候判断是否为正式版用户,这里采用了使用次数来限制,比如只能使用100次或者150次等,如果为正式版则可以正常使用,否则如果在试用期内,就继续修改注册表的次数(为了防止用户修改,可以对其加密)

        private void button3_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            RegistryKey macRegistry = Registry.LocalMachine.OpenSubKey("SYSTEM").OpenSubKey("CurrentControlSet").OpenSubKey("Control").OpenSubKey("Class").OpenSubKey("{4D36E972-E325-11CE-BFC1-08002bE10318}");//mac的注册表建所在
            foreach (string mrk in macRegistry.GetSubKeyNames())
            {
                listBox1.Items.Add(mrk);
            }
            IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
           
            textBox4.Text = computerProperties.HostName;
            NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface adapter in nics)
            {
                if (adapter.Name == "本地连接")
                {
                    textBox2.Text = adapter.Description;
                    textBox3.Text = adapter.GetPhysicalAddress().ToString();
                    textBox10.Text = adapter.Id;
                }
            }
            /////////////////////////////////////////////////////////////////
            ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection moc = mc.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                if (!(bool)mo["IPEnabled"])
                    continue;
                string[] addresses = (string[])mo["IPAddress"];
                string[] subnets = (string[])mo["IPSubnet"];
                foreach (string sad in addresses)
                    textBox7.Text = sad;
                foreach (string sub in subnets)
                    textBox8.Text = sub;
            }

 

        }
    }   
}

图片 2图片 3View Code

================截图=====================
图片 4
还没有生成的样子。

 private void MainForm_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            string diskID = getDiskID.GetHardDiskID();
   
            try
            {
                RegistryKey regist = Registry.LocalMachine;
                RegistryKey software = regist.OpenSubKey("software", true);
                RegistryKey testCountKey = software.CreateSubKey("aaaaaa");
                insID = testCountKey.GetValue("insertID").ToString();
                string list = getDiskID.RegisteNum(diskID);
                DataSet ds = null;
                if (insID == "noInstID" || insID!=list)
                {
                    this.Text += "--试用版";
                    int testCount = Convert.ToInt32(getDiskID.Decrypt(testCountKey.GetValue("insertCount").ToString()));
                    //读取限制的次数
                    ds = XMLHelper.GetDs();
                    string Tcount = getDiskID.Decrypt(ds.Tables[0].Rows[0]["count"].ToString().Trim());
                    int ttCount = Convert.ToInt32(Tcount);
                    if (testCount <= ttCount)
                    {
                        int count = ttCount - testCount;
                        MessageBox.Show("您当前使用的是试用版产品,试用期还剩下" + count.ToString() + "次。");
                        newus = new Login();
                        newus.formLogin = this;
                        this.Hide();
                        newus.Show();
                        return;
                    }
                    if (testCount > ttCount)
                    {
                        MessageBox.Show("您的试用期已到,请购买注册为正式版产品!");
                        this.Hide();
                        registerForm rf = new registerForm();
                        rf.zcID = insID;
                        rf.ShowDialog();
                        return;
                    }

图片 5
生成后的样子。

                }
                else
                {
                    newus = new Login();
                    newus.formLogin = this;
                    this.Hide();
                    newus.Show();
                } 
            }
            catch
            {
                MessageBox.Show("获取注册表信息失败!");
                return;
            }            
          
          
        }

<> <>

最后是注册成正式版的,这里注册码采用的是 对机器的cpu序列号进行加密生成的号码,获取cpu序列号的方法

 

图片 6图片 7View Code

   /// <summary>
        /// 取CPU序列号
        /// </summary>
        /// <returns></returns>
        public string GetHardDiskID()
        {
            string cpuInfo = "";
            ManagementClass cimobject = new ManagementClass("Win32_Processor");
            ManagementObjectCollection moc = cimobject.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                cpuInfo = mo.Properties["ProcessorId"].Value.ToString();
            }

            return cpuInfo;
        }

注册成正式版面板代码

 

图片 8图片 9View Code

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 Card.UI.ClassInfo;
using Microsoft.Win32;

namespace Card.UI
{
    public partial class registerForm : Form
    {
        public registerForm()
        {
            InitializeComponent();
        }
        private string _zcID;
        public string zcID
        {
            get { return _zcID; }
            set { _zcID = value; }
        }
        MD5 md5 = new MD5();
       
        string zcid = "";
        string list = "";
        GetDiskID getDiskID = new GetDiskID();
        private void registerForm_Load(object sender, EventArgs e)
        {
            try
            {
                string CPUID = getDiskID.GetHardDiskID();
                txtProNum.Text = CPUID;
                list = getDiskID.RegisteNum(CPUID);
                if (_zcID == list)
                {
                    txtProNum.Text = _zcID;
                    txtProNum.ReadOnly = true;
                    button1.Enabled = false;
                    textBox2.Text = "";
                }
            }
            catch
            {
                MessageBox.Show("读取序列号失败!");
                return;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (txtProNum.Text != "")
            {
                if (_zcID == "noInstID" || _zcID!=list)
                {
                    if (txtNum.Text.Trim() == list)
                    {
                        try
                        {
                            RegistryKey regist = Registry.LocalMachine;
                            RegistryKey software = regist.OpenSubKey("software", true);
                            RegistryKey testCountKey = software.CreateSubKey("aaaaaa");
                            string myID = "insertID";
                            testCountKey.SetValue(myID, list);

                            MessageBox.Show("恭喜您注册成功!您的注册信息将于重新登录后生效");
                                                  
                            txtNum.ReadOnly = true;
                            textBox2.Text = "    ";
                            button1.Enabled = false;
                            software.Close();
                            regist.Close();
                        }
                        catch
                        {
                            MessageBox.Show("注册表读取失败!");
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("请填写正确的注册码!");
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("读取序列号失败!");
                return;
            }
        }
    }
}

 

本文由威尼斯www.9778.com发布于编程人生,转载请注明出处:C# 操作注册表

关键词:

总结C#中得到程序当前工作目录和执行目录的一些方法

 1.  System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName      获取模块的完整路径。 2.   System.Environment.CurrentDir...

详细>>

WinForm特效:桌面上的遮罩层

把窗体的FormBorderStyle设为FormBorderStyle.None 一个窗体特效,帮你了解几个windowsapi函数.效果:windows桌面上增加一个简单...

详细>>

PHP数组操作详解

下标:数组中的识别名称 也就是字符串或整数在数组中的代号 要访问一个变量的内容,可以直接使用其名称。如果...

详细>>

>>>---PHP中的OOP-->面对过程与面对对象基础概念与内容

  对象的主要三个特性 对象的行为:可以对 对象施加那些操作,开灯,关灯就是行为。 对象的形态:当施加那些方...

详细>>