原创 解决Web安装程序不能选择安装目录问题(4)收藏

INIFile.cs 文件
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace setWebDir
{
  /// <summary>
  /// INIFile 的摘要说明。
  /// </summary>
  public class INIFile
  {
    public string path;
    public INIFile(string INIPath)
    {
      path = INIPath;
    }

    [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);

    public void IniWriteValue(string Section,string Key,string Value)
    {
      WritePrivateProfileString(Section,Key,Value,this.path);
    }

    public string IniReadValue(string Section,string Key)
    {
      StringBuilder temp = new StringBuilder(255);

      int i = GetPrivateProfileString(Section,Key,"",temp, 255, this.path);

      return temp.ToString();
    }

  }
}

发表于 @ 2005年01月25日 14:56:00|评论(loading...)

新一篇: 解决Web安装程序不能选择安装目录问题(3) | 旧一篇: 社会的不公平

用户操作
[即时聊天] [发私信] [加为好友]
luckyjan
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
luckyjan的公告
访问量:
查看:今日天气和日历
文章分类
收藏
    交朋识友
    aweirl(Blog)(RSS)
    dudu(Blog)
    lover_p
    mezzomin(Blog)
    上海博扬广告公司
    博客园
    快乐编程(Blog)
    阿好DotNet(RSS)
    雪峰Blog
    诗词
    存档
    软件项目交易
    Csdn Blog version 3.1a
    Copyright © luckyjan