阅读.ini文件...... [英] reading .ini file...

查看:84
本文介绍了阅读.ini文件......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以知道这个PLZ帮助我

can any one know about this plz help me

推荐答案

你可以自己搜索一下......



试试这个 http:// www。 codeproject.com/Articles/646296/A-Cross-platform-Csharp-Class-for-Using-INI-Files [ ^ ]
you could search for this yourself ...

try this http://www.codeproject.com/Articles/646296/A-Cross-platform-Csharp-Class-for-Using-INI-Files[^]


.INI文件是有些过时了 - 他们不再是推荐的Windows 95操作方式,那是近二十年前的事了! :笑:

但是,如果你必须......

你可以使用仍然有效的Windows方法:

.INI files are somewhat out of date - they stopped being the recommended way of doing things with Windows 95, and that was nearly twenty years ago! :laugh:
However, if you must...
You can use the Windows methods which will still work:
[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);



然后写:


Then to write:

WritePrivateProfileString("Section","Key","Value",pathToINIFile);



并阅读:


And read:

StringBuilder result = new StringBuilder(255);
int i = GetPrivateProfileString("Section", "Key", "Default", result, 255, pathToIINIFile);
string value = result.ToString();


请参考下面的链接,也许有用。





http://jachman.wordpress.com/2006/09/11/how- to-access-ini-files-in-c-net / [ ^ ]



使用C#的INI文件处理类 [ ^ ]
Please refer below links also , may be useful.


http://jachman.wordpress.com/2006/09/11/how-to-access-ini-files-in-c-net/[^]

An INI file handling class using C#[^]


这篇关于阅读.ini文件......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆