用ASP读取Windows标准INI格式文件

yjlqq

yjlqq

2016-01-29 18:18

用ASP读取Windows标准INI格式文件,用ASP读取Windows标准INI格式文件
  Have you needed to get information dynamically from Standard Formatted Windows INI files? Here's a set of tools to help you with just that. In this tutorial, we are going to discuss specific actions. More details can be obtained by looking at the files supplied.

Let's see how to implement the tools usage by looking at some parts of TEST.ASP:


<!--#include virtual="/readini/inifile.inc"--
For fairly obvious reasons, we need to include the tools in our page, of course we should fix the path the include file is stored it.

<%
     call IniFileLoad("physical=c:boot.ini")
%

Next, a call to IniFileLoad fetches the INI file into a dictionary object called IniFileDictionary. You can specify a physical path as listed above, or you could specify a virtual path such as "virtual=/readini/test.ini".


StrBuf = IniFileValue("boot loader|timeout")
StrBuf = IniFileValue("boot loader")

Finally, we need to ask for a value from the dictionary. You can specify an individual value by using the section name and value name separated by a vertical bar (sometimes referred to as a 'pipe') character. Alternately, we can request the entire content of a section by not specifying the value name. When the section is returned, the data is formatted as:

   Section name|Value name=Value Data~Section name|ValueName=Value Data

Note that each section/value/data triplet is separated by a tilde character.

Well, that's all there is to it! Happy programming!

Attachments:
This ZIP file contains an INC file with the utility routines, a test INI file, and an ASP file that demonstrates the tools usage.

http://www.4guysfromrolla.com/webtech/code/inifile.zip

 
展开更多 50%)
分享

猜你喜欢

用ASP读取Windows标准INI格式文件

ASP
用ASP读取Windows标准INI格式文件

如此读取WPSOffice格式文件

办公软件
如此读取WPSOffice格式文件

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

vb建立与读取.ini文件

编程语言 网络编程
vb建立与读取.ini文件

chm是什么格式文件

电脑入门
chm是什么格式文件

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用ASP读INI配置文件的函数

ASP
用ASP读INI配置文件的函数

vob是什么格式文件

电脑入门
vob是什么格式文件

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

一个在vbscript中读取cookie的程序函数

一个在vbscript中读取cookie的程序函数

ASP调用SQL SERVER存储程序

ASP调用SQL SERVER存储程序
下拉加载更多内容 ↓