婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > asp.net操作ini文件示例

asp.net操作ini文件示例

熱門標簽:ai電銷機器人對貸款有幫助嗎 廣州銷售外呼系統定制 怎樣給陜西地圖標注顏色 云狐人工智能電話機器人 福州人工智能電銷機器人加盟 地圖標注多少錢一張 400電話辦理信任翰諾科技 宿遷智能外呼系統排名 電銷機器人 數據

復制代碼 代碼如下:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Runtime.InteropServices;
using System.Text;

namespace CreateWebDir
{
    /// 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();

        }
    }
}

復制代碼 代碼如下:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.IO;

public partial class user_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CreateWebDir.INIFile ab = new CreateWebDir.INIFile(@"F:\test");

        string iniFile = @"F:\test\test.ini";
        if (!File.Exists(iniFile))
        {
            using (FileStream fs = File.Create(iniFile))
            {
                fs.Close();
            }
        }

        string[] args = new string[10];

        CreateWebDir.INIFile myINI = new CreateWebDir.INIFile(iniFile);

        for (int i = 0; i args.Length; i++)
        {
            args[i] = Convert.ToString(i + i * i * i);
            myINI.IniWriteValue("WebDir", "arg" + i.ToString(), args[i]);
        }
    }
}

復制代碼 代碼如下:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.IO;

public partial class user_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CreateWebDir.INIFile ab = new CreateWebDir.INIFile(@"F:\test\test.ini");

        Response.Write(ab.IniReadValue("WebDir", "arg5"));
    }
}

您可能感興趣的文章:
  • ASP.NET操作各類時間段獲取方法匯總
  • ASP.NET批量操作基于原生html標簽的無序列表的三種方法
  • asp.net操作javascript:confirm返回值的兩種方式
  • 一個ASP.NET的MYSQL的數據庫操作類自己封裝的
  • Asp.Net中Cache操作類實例詳解
  • ASP.net中獲取客戶端參數操作系統信息
  • asp.net操作xml增刪改示例分享
  • asp.net 操作cookie的簡單實例
  • Asp.Net用OWC操作Excel的實例代碼
  • ASP.NET中操作SQL數據庫(連接字符串的配置及獲取)
  • asp.net中Repeart選中整行操作實例

標簽:焦作 曲靖 綿陽 新疆 大興安嶺 延安 宜春 黃南

巨人網絡通訊聲明:本文標題《asp.net操作ini文件示例》,本文關鍵詞  asp.net,操作,ini,文件,示例,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp.net操作ini文件示例》相關的同類信息!
  • 本頁收集關于asp.net操作ini文件示例的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 仲巴县| 辽阳县| 宣威市| 中卫市| 历史| 志丹县| 泽库县| 莱芜市| 南岸区| 宝兴县| 田林县| 广饶县| 郧西县| 天等县| 阜新市| 纳雍县| 铜鼓县| 红河县| 衡水市| 巩义市| 图木舒克市| 民权县| 深圳市| 衡阳县| 山东省| 阿巴嘎旗| 平谷区| 龙井市| 厦门市| 拉孜县| 从化市| 公主岭市| 乌鲁木齐市| 景洪市| 沂源县| 甘谷县| 武义县| 忻州市| 新建县| 贵州省| 眉山市|