网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
06月06日漏签0天
vb吧 关注:156,132贴子:1,166,099
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 0回复贴,共1页
<<返回vb吧
>0< 加载中...

求大神帮忙,急,在线等~~

  • 只看楼主
  • 收藏

  • 回复
  • 丶老大叔
  • 啥也不懂
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
我是做java的,但是今天领导给了一段代码让把这个转换成java的格式, = =。无奈看不懂所以来求助各位大神,求帮忙,谢谢。
脚本开头
Function main()
脚本结束
End function
{Function}
Set Common=new CommonClass
main()
Function QTP_Release_Memory(hwnd)
Extern.Declare micVoid ,"SendMessageA","user32.dll","SendMessageA",micHwnd,micInteger,micInteger,micInteger
SC_MINIMIZE = &HF020&
SC_MAXIMIZE = &HF030&
WM_SYSCOMMAND = &H112
Extern.SendMessageA hwnd,WM_SYSCOMMAND,SC_MINIMIZE,0
wait 3
Extern.SendMessageA hwnd,WM_SYSCOMMAND,SC_MAXIMIZE,0
wait 3
End Function
If Err.Number <> 0 Then
snap_screen("运行失败截图")
err.Raise vbObjectError + 513,"",Err.Description
end if
截图 Snap_Screen
Sub snap_screen(param1)
set fs =createobject("scripting.filesystemobject")
If not (fs.FolderExists("{MainDir}\result\image\{track}\{caseId}")) Then
create fs,"{MainDir}\result\image\{track}\{caseId}"
End If
Set objfol=fs.GetFolder("{MainDir}\result\image\{track}\{caseId}")
preIndex=objfol.Files.Count+1
While len(preIndex)<4
preIndex="0"&preIndex
Wend
desktop.CaptureBitmap "{MainDir}\result\image\{track}\{caseId}\"&preIndex&"."&param1&".png",true
End Sub
memSub 变量数据存入数据池,提供变量计算功能
Sub memSub(param1,param2,param3,tableName,isVertical)
memKey = param1
memValue = param2
set fs =createobject("scripting.filesystemobject")
If Not fs.FileExists("{MainDir}\tempData.txt") Then
row=-1
else
set ts=fs.opentextfile("{MainDir}\tempData.txt",1,false,-1)
strComputer = ts.ReadAll
ts.close
strLine = Split(strComputer,vbcrlf)
row = ubound(strLine)'tempData的行数
End If
Dim position,lineValue(500,2),errData'定义最大行数
int index=0
int rowIndex=0
For i=0 to row
If strLine(i) = "" Then
index=index+1
else
tempLine = Split(strLine(i),"$-----$")
lineValue(rowIndex,0) = tempLine(0)
lineValue(rowIndex,1) = tempLine(1)
rowIndex=rowIndex+1
End If
Next
row=row-index
keyFlag = false
tagFlag = false
If InStr (memValue,"<") <> 0 Then
tagFlag = true
End If
For i =0 to row
If lineValue(i,0) = memKey Then
position = i
keyFlag = true
Exit for
End If
Next
If tagFlag Then
memValue = Replace(memValue,"<","")
memValue = Replace(memValue,">","")
TelnetText= content_wait(param3,tableName,isVertical)
TelnetText = Replace(TelnetText,vbcrlf,";")
If InStr(memValue," ")=0 Then
TelnetText = Replace(TelnetText," ",";")
End If
If instr(TelnetText,memValue) Then
'msgbox memValue
tagTemp = Split(TelnetText,"|")
For i =0 to UBound(tagTemp)
If instr( tagTemp(i),memValue) Then
tagTemp2 = Split(tagTemp(i),";")
hasFound=false
For j=0 to Ubound(tagTemp2)
If instr(1,tagTemp2(j),memValue)>0 Then
If instr(1,tagTemp2(j),memValue)+len(memValue)=len(tagTemp2(j))+1 and j<Ubound(tagTemp2) Then
For k=j+1 to Ubound(tagTemp2)
If tagTemp2(k)<>empty and tagTemp2(k)<>"" Then
memValue = tagTemp2(k)
hasFound=true
Exit for
End If
Next
elseif instr(1,tagTemp2(j),memValue)+len(memValue)<len(tagTemp2(j))+1 then
memValue=right(tagTemp2(j),len(tagTemp2(j))-instr(1,tagTemp2(j),memValue)-len(memValue)+1)
hasFound=true
Exit for
else
End If
If hasFound=true Then
Exit for
End If
End If
Next
If hasFound=true Then
Exit for
End If
End If
Next
'Exit Do
else
err.Raise vbObjectError + 513,"","找不到关键字:" & memValue
End If
If not keyFlag Then
lineValue(row+1,0) = memKey
lineValue(row+1,1) = memValue
else
lineValue(position,1) = memValue
End If
else
If not keyFlag Then
lineValue(row+1,0) = memKey
lineValue(row+1,1) = memValue
else
lineValue(position,1) = memValue
End If
End If
set fs =createobject("scripting.filesystemobject")
If fs.FileExists("{MainDir}\tempData.txt") Then
fs.DeleteFile("{MainDir}\tempData.txt")
End If
set ts=fs.opentextfile("{MainDir}\tempData.txt",8,true,-1)
If keyFlag Then
For i =0 to row-1
ts.WriteLine(lineValue(i,0) & "$-----$" &lineValue(i,1))
Next
ts.Write(lineValue(row,0) & "$-----$" &lineValue(row,1))
else
For i =0 to row
ts.WriteLine(lineValue(i,0) & "$-----$" &lineValue(i,1))
Next
ts.Write(lineValue(row+1,0) & "$-----$" &lineValue(row+1,1))
End If
ts.close
End Sub


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 0回复贴,共1页
<<返回vb吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示