怎么用wincc读写INI文件

想通过Windows的API函数,不知道这样能实现不? 怎样实现?

最佳答案

可以,C脚本支持Windows API。
 -------------------------
 #pragma code("Kernel32.dll")
 BOOL GetPrivateProfileStringA(char*,char*,char*,LPCTSTR,long,char*);
 #pragma code()
 char *strSection="MySection";
 char *strKey="MyKey";
 char *szINIFile="C:\\MYINI.INI";
 char szResult[255];
 GetPrivateProfileStringA(strSection,strKey,"",szResult,255,szINIFile);
 printf("\r\nszResult : %s",szResult);
参考资料:http://baike.baidu.com/view/1290400.htm

提问者对于答案的评价:
万分感谢,终于好了

原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc275556.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2019年6月11日
下一篇 2019年6月11日

相关推荐