博文

搜狐博客下载器(2009-04-20 13:34:00)

摘要: http://www.ecn999.com/sohu_blog_bak.rar 上面的连接是 搜狐博客下载器 的下载地址。 欢迎使用并提出宝贵意见。   ......

阅读全文(2642) | 评论:0

VB6中一个非常好用的读写INI文件的模块(2008-09-21 09:03:00)

摘要:  网上读写Ini文件的例子只有几篇相同的文章,而并不好用,奇怪的是各网站都是同样的例程,高手也就罢了,三下五除二就搞定,初学者会被搞得一头雾水,看着一个好好的模块就是不能用。   所以我整理了一下(最早是在腾讯答一个贴子时写的),这个也就是修改了一下,不是我自已的发明(至于这个代码起先不知是谁写的),不过非常的好用   新建模块(建议不使用注册表) 命名为rwini   'ini文件在有回车换行符会出错,经过测试,汉字要小于86字节,英言文要小于143字节才能返回列表框。(这是我以前的code,是记录列表框内容的)
  Option Explicit
  Public iniFileName As String
  Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
  Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As ......

阅读全文(3029) | 评论:0

用VB操作INI文件(2008-09-21 08:51:00)

摘要:一、实现方法如下:

1、新建一个工程/窗体(窗体取名为ini.frm),在此窗体中添加三个命令按钮控件,分别为command1、command2、command3
command1.Caption= "write"
command2.Caption= "read"
command3.Caption= "End"

2、代码部分:
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" ( _
    ByVal lpApplicationName As String, _
    ByVal lpKeyName As String, _
    ByVal nDefault As Long, _
    ByVal lpFileName As String) As Long


Privat......

阅读全文(3745) | 评论:1

INI文件编程,WINAPI函数WritePrivateProfileStrin(2008-09-20 10:26:00)

摘要:    在我们写的程序当中,总有一些配置信息需要保存下来,以便完成程序的功能,最简单的办法就是将这些信息写入INI文件中,程序初始化时再读入.具体应用如下:
  一.将信息写入.INI文件中.
  1.所用的WINAPI函数原型为: 
BOOL WritePrivateProfileString(
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
LPCTSTR lpString,
LPCTSTR lpFileName
); 
  其中各参数的意义:
   LPCTSTR lpAppName 是INI文件中的一个字段名.
   LPCTSTR lpKeyName 是lpAppName下的一个键名,通俗讲就是变量名.
   LPCTSTR lpString 是键值,也就是变量的值,不过必须为LPCTSTR型或CString型的.

LPCTSTR lpFileName 是完整的INI文件名.

2.具体使用方法:设现有一名学生,需把他的姓名和年龄写入 c:\stud\student.ini 文件中. 

CString strName,strTemp;
int nAge;
strName="张三";
nAge=12;
::WritePrivateProfileString("StudentInfo","Name",strName,"c:\\stud\\student.ini"); 

此时c:\stud\student.ini文件中的内容如下:
[StudentInfo]

......

阅读全文(3969) | 评论:1

搜狐博客下载程序(2008-08-28 21:33:00)

摘要: 搜狐博客下载程序 经常查看博客,一页一页的看,很不方便。我就在考虑如何把喜欢的博客通通下载到本地,下载别人的博客可以慢慢阅读,下载自己的博客可以很好的备份,避免博客服务终止的时候自己的文章不知着落。出于这样的需求我使用 VB  编写了搜狐博客的下载程序。 下载程序分三大部分:1.活的所有博文的链接页面。2.提取博文链接。3.下在博文。 例如:图库999 博客 http://tuku999.blog.sohu.com/的日志列表的页面是http://tuku999.blog.sohu.com/entry/,我使用 Inet 控件来打开这个 URL,获得页面的博客链接部分的源文件如下。 <div class="item">
  <div class="item-top"></div>
  <div class="item-title">
    <h3>2008-08-25&nbsp;|&nbsp;<a href="http://tuku999.blog.sohu.com/98151288.html" target="_blank">金发女郎的诱惑 </a>
  
 </h3>
    <div class="item-label">   
   
    <span id="itemId_98151288" class="itemOpr"></span>
    </div>
    <div class="clear"></div>
  </d......

阅读全文(5149) | 评论:1