C#读写本地ini
- //读写INI
- public class GF_INI
- {
- [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);
- [DllImport("kernel32.dll")]
- public static extern int Beep(int dwFreq, int dwDuration);
- //读ini
- public static void iniFile_SetVal(string in_filename, string Section, string Key, string Value)
- {
- WritePrivateProfileString(Section, Key, Value, in_filename);
- }
- //写INI
- public static string iniFile_GetVal(string in_filename, string Section, string Key)
- {
- StringBuilder temp = new StringBuilder(255);
- int i = GetPrivateProfileString(Section, Key, "", temp, 255, in_filename);
- if (i == 0)
- return "";
- else
- return temp.ToString();
- }
- }
C#读写本地ini的更多相关文章
- C# 读写本地配置文件
1.在本地有一个如下配置文件 2.读写本地配置文件 3.对配置文件的内容进行操作
- asp.net 操作INI文件的读写,读写操作本地ini配置文件
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...
- QT 读写配置文件 .ini
高端大气上档次!码住 读取配置文件: //根据目录寻找配置文件 QSettings* setting = new QSettings("configs/config.ini", Q ...
- C# 读本地INI文件方法
[DllImport("kernel32")]//加载dll private static extern int GetPrivateProfileString(string se ...
- 利用Lua读写本地文件
缘由 今天在使用Lua编写脚本时,需要用到读写文件的操作,很久没有使用Lua了,特写下此文来备忘一下. 简介 Lua对文件的操作与C对文件的操作基本一致,不管是参数还是方法.Lua中可以直接通过全局方 ...
- Flutter 读写本地文件
文档 注意 安装 path_provider 插件后重启f5, 而不是等待热更新 demo import 'dart:io'; import 'dart:async'; import 'package ...
- MFC读写配置ini文件
https://blog.csdn.net/naibozhuan3744/article/details/78783446 https://blog.csdn.net/rayborn1105/arti ...
- java读写本地xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <confi ...
- node读写本地文件
http://nodejs.cn/api/fs.html#fs_fs_writefilesync_file_data_options https://www.cnblogs.com/diaosizha ...
随机推荐
- sql 索引创建
--格式 --CREATE [索引类型] INDEX 索引名称--ON 表名(列名)--WITH FILLFACTOR = 填充因子值0~100--GO ----------------------- ...
- 去掉list重复值
/** * 去掉list重复值 */ public List<String> removeDuplicate(List<String> list) { HashSet<S ...
- SIFT算法详解(转)
http://blog.csdn.net/zddblog/article/details/7521424 目录(?)[-] 尺度不变特征变换匹配算法详解 Scale Invariant Feature ...
- listview中item 有checkbox多选防止滑动 listview页面 出现checkbox错位问题
checkbox点击切换背景 <CheckBox android:id="@+id/checkbox" android:layout_width="40dp&quo ...
- 终于有SpringMvc与Struts2的对比啦(转)
本文转自:http://www.itsource.cn/web/news/5/20150318/370.html 目前企业中使用SpringMvc的比例已经远远超过Struts2,那么两者到底有什么区 ...
- mysql笔记03 查询性能优化
查询性能优化 1. 为什么查询速度会慢? 1). 如果把查询看作是一个任务,那么它由一系列子任务组成,每个子任务都会消耗一定的时间.如果要优化查询,实际上要优化其子任务,要么消除其中一些子任务,要么减 ...
- ftp 终端命令
近期使用 macbook,并与新买的路由器折腾, 先备着... http://blog.csdn.net/qinde025/article/details/7595102 ftp使用的内部命令如下(其 ...
- UnicodeDecodeError: ‘ascii’ codec can’t decode...: ordinal not in range(128 问题解决
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 108: ordinal not in range(128 原 ...
- 为Docker容器配置固定IP
当docker以桥接的方式启动容器时,容器内部的IP是经过DHCP获取的,例如:172.17.0.8/32,且每重启依次IP都会发生变动.某些特殊的情况下,需要容器内有自己固定的一个内部IP.我的实现 ...
- 给windows服务打包,并生成安装程序
一. 添加新建项目-->安装部署-->安装项目 二.安装程序上-->右键视图-->文件系统-->应用程序文件夹-->右键-->添加项目输出 选择做好的wind ...