CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VB >  网络编程

用webbrowser 如何提取指定字符串之前,特定位置的字符串?

楼主bo18(明天的明天的明天)2005-09-27 09:35:06 在 VB / 网络编程 提问

指定字符串为当前网页的特征码。  
  比如:  
  <td   align="center"   height="14"   bgcolor="ECEEFF"><font   color=blue>要提取的对象</font></td>  
  <td   align="center"   height="14"   bgcolor="ECEEFF"><font   color=blue>特征码</font></td> 问题点数:20、回复次数:5Top

1 楼xghim((︵-︵))回复于 2005-09-27 09:47:04 得分 20

InStr([start,   ]string1,   string2[,   compare])  
   
  The   InStr   function   syntax   has   these   arguments:  
   
  Part   Description    
  start   Optional.   Numeric   expression   that   sets   the   starting   position   for   each   search.   If   omitted,   search   begins   at   the   first   character   position.   If   start   contains   Null,   an   error   occurs.   The   start   argument   is   required   if   compare   is   specified.    
  string1   Required.   String   expression   being   searched.    
  string2   Required.   String   expression   sought.    
  compare   Optional.   Specifies   the   type   of   string   comparison.   If   compare   is   Null,   an   error   occurs.   If   compare   is   omitted,   the   Option   Compare   setting   determines   the   type   of   comparison.   Specify   a   valid   LCID   (LocaleID)   to   use   locale-specific   rules   in   the   comparison.    
   
   
  Settings  
   
  The   compare   argument   settings   are:  
   
  Constant   Value   Description    
  vbUseCompareOption   -1   Performs   a   comparison   using   the   setting   of   the   Option   Compare   statement.    
  vbBinaryCompare   0   Performs   a   binary   comparison.    
  vbTextCompare   1   Performs   a   textual   comparison.    
  vbDatabaseCompare   2   Microsoft   Access   only.   Performs   a   comparison   based   on   information   in   your   database.    
   
   
  Return   Values  
   
  If   InStr   returns    
  string1   is   zero-length   0    
  string1   is   Null   Null    
  string2   is   zero-length   start    
  string2   is   Null   Null    
  string2   is   not   found   0    
  string2   is   found   within   string1     Position   at   which   match   is   found    
  start   >   string2   0    
   
   
  Remarks  
   
  The   InStrB   function   is   used   with   byte   data   contained   in   a   string.   Instead   of   returning   the   character   position   of   the   first   occurrence   of   one   string   within   another,   InStrB   returns   the   byte   position.  
   
  Top

2 楼xghim((︵-︵))回复于 2005-09-27 09:47:29 得分 0

InStr   Function   Example  
  This   example   uses   the   InStr   function   to   return   the   position   of   the   first   occurrence   of   one   string   within   another.  
   
  Dim   SearchString,   SearchChar,   MyPos  
  SearchString   ="XXpXXpXXPXXP"       '   String   to   search   in.  
  SearchChar   =   "P"       '   Search   for   "P".  
   
  '   A   textual   comparison   starting   at   position   4.   Returns   6.  
  MyPos   =   Instr(4,   SearchString,   SearchChar,   1)        
   
  '   A   binary   comparison   starting   at   position   1.   Returns   9.  
  MyPos   =   Instr(1,   SearchString,   SearchChar,   0)  
   
  '   Comparison   is   binary   by   default   (last   argument   is   omitted).  
  MyPos   =   Instr(SearchString,   SearchChar)       '   Returns   9.  
   
  MyPos   =   Instr(1,   SearchString,   "W")       '   Returns   0.  
   
  Top

3 楼bo18(明天的明天的明天)回复于 2005-09-27 10:04:26 得分 0

@%#&¥!%¥#%?、?Top

4 楼bo18(明天的明天的明天)回复于 2005-09-27 15:51:16 得分 0

无法解决Top

5 楼bo18(明天的明天的明天)回复于 2005-09-27 17:01:28 得分 0

dingTop

相关问题

  • 从字符串中提取指定的字符串
  • 如何在一串指定的字符串里面提取一个指定的字符串。
  • 怎样提取指定字符串?(T-SQL语句)
  • 求提取指定字符串的方法
  • 提取字符串
  • 提取字符串
  • 如何从含有特定的分割符的字符串中提取指定的字符串?
  • 如何用WebBrowser在网页中查找指定的字符串??
  • 字符串提取问题
  • 怎样提取字符串?

关键词

  • start
  • 字符串
  • compare
  • comparison
  • argument
  • specify
  • required
  • expression
  • searched
  • option

得分解答快速导航

  • 帖主:bo18
  • xghim

相关链接

  • Visual Basic类图书
  • Visual Basic类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo