//DllImport ini
using System.Runtime.InteropServices;
//StringBuilder
using System.Text;
//DllImport 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);
StringBuilder ret = new StringBuilder (256);
GetPrivateProfileString("Title", "Key", "Defualt", ret, 256, filepath);
GetPrivateProfileString에서 StringBuilder를 사용하는 이유는 return값이 write되는 char[]형이기 때문이다.
No comments:
Post a Comment