C# DLL 가져오기 간단한 방법

730 단어 C#
//     
using System.Runtime.InteropServices;

// kernel32.dll  ,   GetPrivateProfileString  

//         
[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 GetInt32(string Section, string Key, string Default, ref int Value)
{
    StringBuilder retVal = new StringBuilder(1024);
    GetPrivateProfileString(Section, Key, Default, retVal, 1024, this.Path);
    Value = Int32.Parse(retVal.ToString());
}



좋은 웹페이지 즐겨찾기