当前位置:网站首页>C read INI file and write data to INI file
C read INI file and write data to INI file
2022-04-23 07:54:00 【Dake mountain man】
// Read INI file
[DllImport("kernel32")]
public static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
// towards ini File write data
[DllImport("kernel32")]
public static extern long WritePrivateProfileString(string mpAppName, string mpkeyName,
string mpDefault, string mpFileName);
// Timed shutdown
[DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
public static extern bool ExitWindowsEx(int uFlags, int dwReserved);
// close , Restart the system and have all permissions
[DllImport("ntdll.dll", ExactSpelling = true, SetLastError = true)]
public static extern bool RtlAdjustPrivilege(int htok, bool disall, bool newst, ref int len);
/// <summary>
/// from ini Read the specified value in
/// </summary>
/// <param name="section">ini The node of </param>
/// <param name="key"> Items under node </param>
/// <param name="def"> Return the default value if it is not found </param>
/// <param name="filePath"> File path to read </param>
/// <returns> Return the content of the node to be read </returns>
public static string GetIniFileString(string section, string key, string def, string filePath)
{
StringBuilder temp = new StringBuilder(1024);
GetPrivateProfileString(section, key, def, temp, 1024, filePath);
return temp.ToString();
}
版权声明
本文为[Dake mountain man]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230625378293.html
边栏推荐
- 庄懂的TA笔记(零)<铺垫与学习方法>
- SampleCameraFilter
- A programmer who works four hours a day
- Electronic builder package error: proxyconnect TCP: Dial TCP: 0: connectex
- About USB flash drive data prompt raw, need to format, data recovery notes
- Houdini>刚体, 刚体破碎RBD
- SampleCameraFilter
- Houdini地形与流体解算(模拟泥石流)
- 03use of scanner class (console input)
- Simplify exporting to SVG data files and all images in SVG folder
猜你喜欢
C # control the camera, rotate and drag the observation script (similar to scenes observation mode)
对复杂字典Dictionary&lt;T1,T2&gt;排序问题
Towords Open World Object Detection
Common markdown grammar learning
Mongodb 启动警告信息处理
使用flask时代码无报错自动结束,无法保持连接,访问不了url。
SQL sorts string numbers
TA notes of Zhuang understand (VII) < Lambert + Phong + shadow + 3evcolor + Ao >
STO With Billing 跨公司库存转储退货
Protobuf use
随机推荐
unity UGUI判断点击在UI上和3D物体上的解决方案
MySQL8. 0 installation / uninstallation tutorial [window10 version]
Unity 获取一个资源被那些资源引用
Houdini>刚体, 刚体破碎RBD
C # use laida criterion (3) σ Criteria) reject abnormal data (.Net reject singular values in a group of data)
Unity 获取一个文件依赖的资源
What's new in. Net 5 NET 5
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
Towords Open World Object Detection
NodeJS(六) 子进程操作
TimelineWindow
事件系统(二)多播事件
Unity获取真实地理地图应用Terrain笔记
Dropping Pixels for Adversarial Robustness
C#控制相机,旋转,拖拽观察脚本(类似Scenes观察方式)
SVG中Path Data数据简化及文件夹所有文件批量导出为图片
VBA調用SAP RFC實現數據讀取&寫入
Protobuf 使用
VBA appelle SAP RFC pour réaliser la lecture et l'écriture des données
Personality charm of high paid it workers