VB程序员博客

VB程序开发

通过 GetWindowRect 可以得到一个窗口的位置和大小.
但能过getClientRect无法得到一个客户区的位置,只能得到大小 .
但SPY++得到了,他是如何做的呢?
http://upload.banzhu.net/User_UploadFiles/2010/7/19/201007192228332587.jpgdim psl as pointl
clienttoscreen hwnd,psl

msgbox "clientpoints is:" & psl.x & psl.y

dim rct as rect
getclientrect hwnd,rct
rct.left = psl.x
rct.top =psl.y

msgbox "client rect is: " rct.left,rct.top,rct.width,rct.height
帮顶。。。。


通过 GetWindowRect 可以得到一个窗口的位置和大小.
但能过getClientRect无法得到一个客户区的位置,只能得到大小 .
但SPY++得到了,他是如何做的呢?
http://upload.banzhu.net/User_UploadFiles/2010/7/19/201007192228332587.jpgdim psl as pointl
clienttoscreen hwnd,psl

msgbox "clientpoints is:" & psl.x & psl.y

dim rct as rect
getclientrect hwnd,rct
rct.left = psl.x
rct.top =psl.y

msgbox "client rect is: " rct.left,rct.top,rct.width,rct.height
帮顶。。。。


通过 GetWindowRect 可以得到一个窗口的位置和大小.
但能过getClientRect无法得到一个客户区的位置,只能得到大小 .
但SPY++得到了,他是如何做的呢?
http://upload.banzhu.net/User_UploadFiles/2010/7/19/201007192228332587.jpgdim psl as pointl
clienttoscreen hwnd,psl

msgbox "clientpoints is:" & psl.x & psl.y

dim rct as rect
getclientrect hwnd,rct
rct.left = psl.x
rct.top =psl.y

msgbox "client rect is: " rct.left,rct.top,rct.width,rct.height
帮顶。。。。


新浪财经频道的原油信息:http://finance.sina.com.cn/money/future/CL/quote.shtml

他是分分钟都在变的,我想实时通过vb获得

不懂啊,大家给详细一点的代码啊,谢谢我想获得“最新价”这个内容

把他下下来了在本地取内容


新浪财经频道的原油信息:http://finance.sina.com.cn/money/future/CL/quote.shtml

他是分分钟都在变的,我想实时通过vb获得

不懂啊,大家给详细一点的代码啊,谢谢我想获得“最新价”这个内容

把他下下来了在本地取内容


比如有段sql语句
rs.open "select * form table1"
假如table1不存在怎么捕捉到这个错误而不是报错,比如得到不存在表的信息,msgbox "此数据表不存在"openschema()这个方法可以知道数据库中有哪些表
好像只适合mdbinformix里
select count(㗯𜉠from systables where tabname = '…'


窗体 上有command1,text1,在text1中输入 一个QQ号,点command1的时候,msgbox 出这个QQ号的昵称,在线等 !!!问马化腾用一组api得到,很麻烦<
up有点麻烦 哦!首先建立一个模块:
Function GetPage(Url, LG)
On Error GoTo Exittag:
Dim Retrieval As Object
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", Url, False, "", ""
.Send
GetPage = BytesToBstr(.responseBody, LG)
End With
Set Retrieval = Nothing
Exit Function
Exittag:
'MsgBox "对不起,查询超时,请确保您的网络或目标主机网络是否正常!"
Err.Clear
End Function
Public Function BytesToBstr(body, Cset)
  Dim objstream
  Set objstream = CreateObject("adodb.stream")
  objstream.Type = 1
  objstream.Mode = 3
  objstream.Open
  objstream.Write body
  objstream.Position = 0
  objstream.Type = 2
  objstream.Charset = Cset
  BytesToBstr = objstream.ReadText
  objstream.Close
  Set objstream = Nothing
  End Function
Function GetKey(HTML, Start, Last)
Dim Filearray, Filearray2
On Error Resume Next
Filearray = Split(HTML, Start)
Filearray2 = Split(Filearray(1), Last)
GetKey = Filearray2(0)
End Function
窗口代码:
Private Sub Command1_Click()
MsgBox GetKey(GetPage("http://user.qbar.qq.com/" & text1.text & "/", "GB2312")," <h3> <strong>"," <span>")
End Sub <h3> <strong>之间没有空格呀 <span>前面也没有空格,发表时系统自动加上去的


我在做一个网络采集程序,在分析一个网页时无法得到一个由javascript生产的链接地址,请各位大虾教教小弟!感激不尽!
网页地址:http://jlzx.k12.com.cn/derup/page/detail.php/K12CENTER000002-0000000000506993?0ec7fcb5c260612c797510fdea3b4cd7
在IE里可以看到"下载点:本地下载"这样的文字,其中"本地下载"是一个链接,但点"属性"只能看到指向自己的地址"http://jlzx.k12.com.cn/derup/page/detail.php/K12CENTER000002-0000000000506993?0ec7fcb5c260612c797510fdea3b4cd7#"
在分析网页源文件时发现生成"本地下载"这个链接地址的是由一个javascript来完成的,代码如下
<a href="#" onclick="urlhref(''+t.url+'');">';

if(gDerupId == t.derupId  || "" == t.derupId){
download_url += "本地下载 </a> </p>";
}else{
download_url += t.corpName + " </a> </p>";
}
}
而分析urlhref 这个函数时,却怎么也无法找到它是怎么生成t.url这个东东的,也就无法得知具体的下载页地址,但如果用鼠标在IE中点击这个"本地下载"就可以看到一个弹窗,在弹窗中可以看到真正的下载地址.

所以想请大家看看怎么才能得到这个链接地址?getAttribute("onclick") <input  id= "in_name "  name= "in_name "  maxlength= "11 "  class= "text "  le= "width:149px; "/>
<input  id= "in_password "  name= "in_password "  type= "password "  class= "text "  style= "width:126px; "/>
<input  type= "image "  src= "images/mfs2/mfw/l01.gif "  id= "Login "  style= "margin-left:190px; "/>

WebBrowser1.Document.All( "in_name ").Value  =  "123456 "          '帐号
WebBrowser1.Document.All( "in_password ").Value  =  "xxxxx "      '密码 
WebBrowser1.Document.All( "Login ").Click        '点击提交按钮TO 小猪妹马甲之八卦兔子:
我对java不熟悉,用baidu查了一些关于getattribute的资料,好象是用于服务器端的函数,我是用VB写一个类似于网络爬虫的程序,不知该怎么使用这个函数?
TO 悬崖边的舞者:
你可能没明白我的意思,首先我无法得到其ID,另外用.click方法我也试过,无法得到弹出窗口的代码的。补充一下:如果用fontpage打开,可以看到是这样一段代码在提供下载地址:“            <script type="text/javascript">document.write(download_url); </script>
”。set objs=WebBrowser1.Document.getElementsByTagName("a")
for i=0 to objs.length-1
msgbox objs[i].getAttribute("onclick")
next

好久没写vb了,好亲切的说…谢谢小猪妹马甲之八卦兔子!马上测试,如果通过就结贴网络爬虫我经常写

webbrowser这种是我最拿手的,不过,这个有很多缺陷,太慢了,而且分析的时候不灵活

好处是超级简单

如果你对dhtml很熟悉的话,将会相当的简单lz实验的如何?为什么我按照这个什么都得不到啊?


想将窗口中的菜单信息取出来用一个treeview来显示,但现在问题是使用 controls集合可以取得所有的菜单名,但是它的上级菜单是哪一个??这个问题困扰了我很久,但现在必须要用了…

嗯,解决了,但为什么连个接分的人都没有???

接分

哪就不客气了

学习学习

学习中………………

我也来接下… 

接分

学习下。

up

接分~

我实现过类似问题,当时是在代码中把每个菜单的tag值设置成父菜单的key值。如果是顶级菜单为空。然后遍历实现的

学习来了


Int(Rnd() * 11)可以得到0-10的整数吗?
请教!

是的

RND公式

Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

以上语句生成的是lowerbound-upperbound之间的整数

INT(rnd*范围+基数)
这样取出来的就是你要的范围了.

你的 0-10
  范围=11  (就是大的减小的再加一)
  基数就是小的那个,你的就是0
  所以是  int(rnd*11+0)

谢谢几位高人!结账!