将配置文件的信息现在在文本框中。

解决方案 »

  1.   

    看什么格式的,,xml还是ini或者搜一下嘛,,网上一大把,,
      

  2.   

    配置文件也是XML格式的
    根据XML的 思想去读
      

  3.   

    using System.Runtime.InteropServices;//添加引用 
    public class IniFile
        {
            public string path;        [DllImport("kernel32 ")]
            private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
            [DllImport("kernel32 ")]
            private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);        ///   <summary> 
            ///   INIFile   Constructor. 
            ///   </summary> 
            ///   <PARAM   name= "INIPath "> </PARAM> 
            public IniFile(string INIPath)
            {
                path = INIPath;
            }
            ///   <summary> 
            ///   Write   Data   to   the   INI   File 
            ///   </summary> 
            ///   <PARAM   name= "Section "> </PARAM> 
            ///   Section   name 
            ///   <PARAM   name= "Key "> </PARAM> 
            ///   Key   Name 
            ///   <PARAM   name= "Value "> </PARAM> 
            ///   Value   Name 
            //public void IniWriteValue(string Section, string Key, string Value)
            //{
            //    WritePrivateProfileString(Section, Key, Value, this.path);
            //}        ///   <summary> 
            ///   Read   Data   Value   From   the   Ini   File 
            ///   </summary> 
            ///   <PARAM   name= "Section "> </PARAM> 
            ///   <PARAM   name= "Key "> </PARAM> 
            ///   <PARAM   name= "Path "> </PARAM> 
            ///   <returns> </returns> 
            public string IniReadValue(string Section, string Key)
            {
                StringBuilder temp = new StringBuilder(255);
                int i = GetPrivateProfileString(Section, Key, " ", temp, 255, this.path);
                return temp.ToString();        }
        }这是读INI格式的,其他的可以搜一下 呵呵
      

  4.   

    是ini,还是config文件
    ini GetPrivateProfileString
    config通过xml,System.Web.Configuration.WebConfigurationManager
      

  5.   

    什么格式的配置文件啊.ini  还是.config前者用api   后者xml解析就可以
      

  6.   

    用XML 怎么搞,XML是不是方便些啊