ChinaUnix.net
相关文章推荐:

vb 读写ini文件

ini 文件文件是Windows系统中一类比较重要的文件,通常用来存放系统或者应用程序的配置信息,以方便系统或者应用程序在初始化时再次读入。比如 Windows系统中的配置文件win.ini和system.ini,它们就主要存放系统启动或用户登陆时的系统信息。其结构如下: [My Section] dir=frob My Section 是段名; dir是键(key), frob是键值; 应用通常是通过锻炼和键,得到键值。 在python中读写ini文件,使用的方法是: class RawCon...

by TerryHao - Python文档中心 - 2008-03-19 12:58:10 阅读(1003) 回复(0)

相关讨论

[code]package com.3a.util.paraconf; /** * ini configuration file helper. * By 3a * 2007-1-16 */ import java.io.*; import java.util.*; import java.util.regex.*; import java.lang.reflect.*; import com.3a.test.FtpSection; public class ConfigFile implements ConfigFileListener { String PATTERN_REM = "^#.*$"; String PATTERN_SECTION = "^\\[([^\\]]*).*$"; String PATTERN_PROPERTY = "(^[^#][^=...

by awk就是awp加ak - Java - 2007-01-22 09:50:33 阅读(1977) 回复(9)

import java.io.*; public class t2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try{ File read = new File("c:\\1.ini"); File write = new File("c:\\2.ini"); BufferedReader br = new BufferedReader( new FileReader(read)); BufferedWriter bw = new BufferedWriter( new FileWriter(w...

by meteorm - Java文档中心 - 2009-01-07 09:49:44 阅读(758) 回复(0)

CODE: [Copy to clipboard] package com.3a.util.paraconf; /** * ini configuration file helper. * By 3a * 2007-1-16 */ import java.io.*; import java.util.*; import java.util.regex.*; import java.lang.reflect.*; import com.3a.test.FtpSection; public class ConfigFile implements ConfigFileListener { String PATTERN_REM = "^#.*$"; String PATTERN_SECTION = "^\\[([^\\]]*).*$"; String PATTERN_PROPERTY...

by awk就是awp加ak - Java文档中心 - 2007-01-29 09:59:24 阅读(710) 回复(0)

在VC++中读写ini文件   在我们写的程序当中,总有一些配置信息需要保存下来,以便完成程序的功能,最简单的办法就是将这些信息写入ini文件中,程序初始化时再读入.具体应用如下:   一.将信息写入.ini文件中.   1.所用的WINAPI函数原型为: BOOL WritePrivateProfileString( LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTSTR lpFileName );   其中各参数的意义:    LPCTSTR lpAppName 是ini文件中的一个字...

by superaurora - AIX文档中心 - 2007-03-13 07:07:14 阅读(656) 回复(0)

如题, 找了好久都没找到:em11: :em11: 最好是C代码 测试结果 P4 2.4 1G windows API WritePrivateProfileString 1000次 4.263224 秒 5000 42.993980 秒 大家可以测试一下,现在基本上没找到比windows API WritePrivateProfileString 更快的写ini的方法 附上测试代码 int main() { const char *file ="c:\\myconfig.ini"; const char *section = "student"; const char *name_key = "name"; cons...

by xfly_t - C/C++ - 2008-08-26 23:18:26 阅读(4792) 回复(18)

3个文件 configfile.h 接口定义文件 configfilev1.h configfilev1.cpp 实现 ************************************************ configfile.h ************************************************ #if !defined(AFX_MODIFYini_H__C8CFF5D5_0F26_43EB_B95B_9F9ABAE66CF4__INCLUDED_) #define AFX_MODIFYini_H__C8CFF5D5_0F26_43EB_B95B_9F9ABAE66CF4__INCLUDED_ #include ; using namespace std; class ConfigFile ...

by hatname - C/C++ - 2005-09-06 17:42:46 阅读(2087) 回复(6)

有一a.ini文件。 ------------------- disk_id=5540 ipaddr=192.168.0.200 ---------------- 如何取出5540,192.168.0.200 谢谢!!

by udb6688 - C/C++ - 2008-07-17 19:17:24 阅读(1682) 回复(11)

研究JAVA来读取ini文件一下午,终于搞出来了一个。但是比较遗憾的是在WEB应用中还是不能成功! 现在我将我的代码贴出来: package tmp; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; public class Test { public static void main(String[] args){ Properties p = new Properties(); FileInputStream fs = null...

by hkebao - Java文档中心 - 2008-11-14 21:25:41 阅读(767) 回复(0)

在shell中要读取ini,直接通过. ./FILENAME就可以了 perl有没有什么比较方便的方式或者module中的预定义函数可以用来读取ini啊? 难道只有通过分析ini将=前的内容和变量名称比较再去后面的值来读取ini麽? 请高手指教,谢谢!

by risepp - Perl - 2008-03-27 22:13:08 阅读(4515) 回复(4)

if(sessions!=null) { sessionurl = (String)sessions.getAttribute("sessionurl"); loginuser = (String)sessions.getAttribute("loginuser"); user = (String)sessions.getAttribute("user"); password = (String)sessions.getAttribute("password"); machineryid = (String)sessions.getAttribute("machineryid"); machineryph = (String)sessions.getAttribute("machineryph"); if(user==null) { out.println(""); ...

by xhc800325 - Java文档中心 - 2006-02-23 15:54:34 阅读(373) 回复(0)