using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace GMD_EXCELLUSDevice
{
public static class PatientIniConfig
{
//获取或设置当前工作目录完全限定路径:public static string FInipath = System.Environment.CurrentDirectory + "文件夹名字 + "\\配置文件夹.ini";
public static string FInipath;
//此变量/函数是在别处定义的,要在此处引用【DllImport("kernel32"):这叫引入kernel32.dll这个动态连接库bai】
//利用动态库DllIAmport("kernel32")
[DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
//[DllImport("kernel32")]:修饰符用于声明在外部实现的方法。
[DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
/// 写入
C#创建ini配置文件
最新推荐文章于 2024-05-29 00:15:00 发布