网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.如何使用asp创建dsn.
.ASP中取得图片宽度和高度的类(无.
.实践xml缓存技术构建高性能web站.
.ASP+JS处理复杂表单的生成与验证.
.ASPEMAIL通过Mdaemon的SMTP发信-.
.如何用checkbox做多选删除.
.ASP程序密码验证问题 (MS,缺陷).
.利用http组件实现多引擎搜索功能.
.ASP文件操作--列出目录及文件&nb.
.用ASP语言实现对SQL SERVER 数据.
.如何使用XQI?.
.ASP实用技巧28则.
.用SQL实现分布式数据复制.
.提高ASP页面的执行效率(上).
.用asp做access的远程接口.
.利用instr()函数防止SQL注入攻击.
.用ADO STREAM做的无组件上传程序.
.利用OWC服务器端组件动态生成图表.
.怎样把数据库结构显示出来的源代.
.ADO数据与XML数据间的转换的类.

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

发表日期:2001-2-21


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

上一篇:怎样使用ASP实现Ping 人气:12777
下一篇:使用ActiveX控件开发网页常见的问题 人气:18078
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐