狠狠色丁香婷婷综合尤物/久久精品综合一区二区三区/中国有色金属学报/国产日韩欧美在线观看 - 国产一区二区三区四区五区tv

LOGO OA教程 ERP教程 模切知識(shí)交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

WinHttpRequest使用方法,WinHttpRequest演示實(shí)例

admin
2012年8月20日 8:44 本文熱度 4843

最近經(jīng)常需要開發(fā)API,Microsoft.XMLHttp、MSXML2.XMLHTTP 等組件不能滿足我的要求(主要是不能自定義header等信息),通過查資料發(fā)現(xiàn)了WinHttp.WinHttpRequest.5.1,但是關(guān)于winhttprequest的資料太少了。通過這幾天摸索,勉強(qiáng)了解了WinHttpRequest使用方法


WinHttp.WinHttpRequest是一個(gè)非常實(shí)用的一個(gè)組件。作為站長,就會(huì)經(jīng)常關(guān)注自己網(wǎng)站的流浪,今天以 免登陸獲得cnzz統(tǒng)計(jì)信息 和 免登陸獲得51.la統(tǒng)計(jì)信息 為例,一起了解下WinHttpRequest的使用方法。CNZZ會(huì)員系統(tǒng)沒有使用驗(yàn)證碼,而51.la使用了驗(yàn)證碼,針對(duì)兩種不同的系統(tǒng),我們分兩種方法討論。



實(shí)時(shí)獲取CNZZ統(tǒng)計(jì)信息 ASP版
WinHttp.WinHttpRequest采集無驗(yàn)證碼會(huì)員系統(tǒng)實(shí)例
實(shí)時(shí)獲取51.la統(tǒng)計(jì)信息 ASP版
WinHttp.WinHttpRequest采集有驗(yàn)證碼會(huì)員系統(tǒng)實(shí)例



實(shí)時(shí)獲取CNZZ統(tǒng)計(jì)信息 ASP版









1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252


'=====================================================================

'=            WinHttpRequest演示實(shí)例 - 實(shí)時(shí)獲取CNZZ統(tǒng)計(jì)信息          =

'=     Copyright (c) 2011 貓七(QQ:77068320) All rights reserverd.    =

'=              請尊重作者勞動(dòng)成果,轉(zhuǎn)載請保留代碼的完整性           =

'=====================================================================

'= 作者:苗啟源(博客:http://www.miaoqiyuan.cn)                       =



'=====================================================================

'=  返回首頁站點(diǎn)列表: winhttprequest_demo.asp                       =

'=  返回某站統(tǒng)計(jì)數(shù)據(jù): winhttprequest_demo.asp?act=data&id=[站點(diǎn)ID]  =

'=====================================================================

'=  文件名:winhttprequest_demo.asp                                  =

'=  功  能:免登陸查看CNZZ 網(wǎng)站流量統(tǒng)計(jì)信息                          =

'=====================================================================

 

Dim HttpID,AppName,CNZZ_User,CNZZ_Password

HttpID        = 0

AppName       = "app_cnzz.com_demo"                   '應(yīng)用程序名前綴,防止感染其他程序Application變量

CNZZ_User     = "kefu@myw3.cn"                        'CNZZ賬號(hào)

CNZZ_Password = "CNZZTEST"                            'CNZZ密碼

 

'函數(shù)名:OpenHttp

'功  能:創(chuàng)建Http請求,并返回服務(wù)器處理結(jié)果

'參  數(shù):url          請求地址

'        PostData     請求數(shù)據(jù)包,如果是Get請求,請以SENDTYPE=GET開頭

'        &strlocation 如果是服務(wù)器重定向網(wǎng)址,則返回重定向的地址

'特  點(diǎn):自動(dòng)保存/共享cookies,多次請求能保存登錄狀態(tài)

Function OpenHttp(byval url,byval PostData,byref strlocation)

    dim xmlhttp,xmlget,bgpos,endpos,sendtype

    HttpID = HttpID + 1

    if HttpID > 10 then

      response.write "1,連接次數(shù)過多"

      response.end

    end if

    strlocation = ""

    sendtype = "SENDTYPE=GET"

    Set xmlhttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

    xmlhttp.Option(6)=0

    With xmlhttp

      .setTimeouts 200000,200000,200000,200000

      if left(PostData,len(sendtype)) = sendtype then

        url = url & "?" & replace(PostData,sendtype,"")

        PostData = ""

        .Open "GET", url , False

      else

        .Open "POST", url, False

      end if

      .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"

      .setRequestHeader "Content-Length",Len(PostData)

      .setRequestHeader "Referer","

      If Application(AppName & "APIOPcookie")<>"" Then .setRequestHeader "COOKIE", Application(AppName & "APIOPcookie")

      .Send PostData

      If InStr(LCase(.GetAllResponseHeaders),"location:") Then

        strlocation = .GetResponseHeader("location")

      end if

      If InStr(.GetAllResponseHeaders,"Set-Cookie") Then

        If InStr(.getResponseHeader("Set-Cookie"),"PHPSESSID") or InStr(.getResponseHeader("Set-Cookie"),"SPSESSION") then

          Application(AppName & "APIOPcookie") = .getResponseHeader("Set-Cookie")

          Application(AppName & "APIOPcookie") = left(Application(AppName & "APIOPcookie"),instr(1,Application(AppName & "APIOPcookie"),";")-1)

        End if

      End If

      xmlget = bin2str(.responseBody)

    End With

    set xmlhttp = nothing

    OpenHttp = xmlget

End Function

 

'函數(shù)名:bin2str

'功  能:將2進(jìn)制值轉(zhuǎn)換為GB2312編碼的字符串

'參  數(shù):binstr       要轉(zhuǎn)換的字符

Function bin2str(byval binstr)

    Const adTypeBinary = 1

    Const adTypeText = 2

    Dim BytesStream,StringReturn

    Set BytesStream = Server.CreateObject("ADODB.Stream")

    With BytesStream

    .Type = adTypeText

    .Open

    .WriteText binstr

    .Position = 0

    .Charset = "GB2312"

    .Position = 2

    StringReturn = .ReadText

    .close

    End With

    Set BytesStream = Nothing

    bin2str = StringReturn

End Function

 

'函數(shù)名:OpenRegExp

'功  能:創(chuàng)建正則對(duì)象,如果已經(jīng)創(chuàng)建,則不重復(fù)創(chuàng)建

'參  數(shù):&re       要?jiǎng)?chuàng)建的正則對(duì)象變量名稱

function OpenRegExp(byref re)

  if not isobject(re) then

    set re = new RegExp

    re.ignorecase = true

    re.global     = true

  end if

end function

 

'函數(shù)名:OnlyTd

'功  能:去掉字體樣式、換行符、空格

'參  數(shù):html      要處理的Html代碼

function OnlyTd(byval Html)

  Html = replace(Html,vbCrlf,"")

  Html = replace(Html,"<br />","")

  Html = replace(Html,"<br>","")

  Html = replace(Html,"<br/>","")

  Html = replace(Html,"</font>","")

  Html = replace(Html,"&nbsp;","")

  call OpenRegExp(re)

  Html = re.replace(Html,"")

  re.pattern = "<font([^<]*)>"

  Html = re.replace(Html,"")

  OnlyTd = Html

end function

 

'函數(shù)名:NotLink

'功  能:去掉所有鏈接

'參  數(shù):html      要處理的Html代碼

function NotLink(byval Html)

  call OpenRegExp(re)

  Html = replace(Html,"</a>","")

  re.pattern = "<a([^<]*)>"

  Html = re.replace(Html,"")

  NotLink = Html

end function

 

'函數(shù)名:notImage

'功  能:去掉所有圖片標(biāo)簽

'參  數(shù):html      要處理的Html代碼

function notImage(byval Html)

  call OpenRegExp(re)

  re.pattern = "<img([^<]*)>"

  Html = re.replace(Html,"")

  notImage = Html

end function

 

'函數(shù)名:midtrim

'功  能:去掉所有多余的空格

'參  數(shù):html      要處理的Html代碼

function midtrim(byval s)

  s = trim(s)

  s = replace(s," ","")

  for k = 0 to 50

    s = replace(s,"  "," ")

  next

  midtrim = s

end function

 

'函數(shù)名:Connect

'功  能:連接CNZZ并返回處理結(jié)果,如果沒有登錄,自動(dòng)重新登錄


'        str      請求的數(shù)據(jù)

Function Connect(byval act,byval str)

  dim html


  '如果未登錄狀態(tài)

  if instr(html,"已超時(shí),請重新登錄")>0 then

    '重新登陸


    if strlocation <> "/v1/main.php?s=site_list" then

      response.write "http://賬號(hào)認(rèn)證失敗"

    end if

    Connect = Connect(act,str)

  else

    Connect = html

  end if

End Function

 

'方法名:getData

'功  能:從CNZZ返回某站點(diǎn)數(shù)據(jù)

Sub getData()

  dim id,html

  id = request("id")

  if trim(id) = "" or not isnumeric(id) then

    response.write "http://非法請求"

  else

    id = cLng(id)

    html = Connect("v1/data/site_list_data","SENDTYPE=GETsiteid=" & id)

    html = "var data_arr = " & html & ";" & _

           "var data_obj = document.getElementById('" & id & "_ty').getElementsByTagName('td');" & _

           "data_obj[5].colSpan = 1;" & _

           "var data_cel = data_obj[5].parentNode;" & _

           "data_cel.insertCell();" & _

           "data_cel.insertCell();" & _

           "var outstr = '<table width=""100%"">';" & _

           "data_obj[1].innerHTML = data_arr[0][0];" & _

           "data_obj[2].innerHTML = data_arr[0][1];" & _

           "data_obj[3].innerHTML = data_arr[0][2];" & _

           "data_obj[5].innerHTML = data_arr[1][0];" & _

           "data_obj[6].innerHTML = data_arr[1][1];" & _

           "data_obj[7].innerHTML = data_arr[1][2];" & _

           ""

    response.write html

  end if

End Sub

 

'方法名:Main

'功  能:從CNZZ返回站點(diǎn)列表

Sub Main()

  dim html

  html = Connect("v1/main","SENDTYPE=GETs=site_list")

  html = onlyTd(html)

  html = notlink(html)

  html = notImage(html)

  Call OpenRegExp(re)

  html = replace(html,"獲取代碼 | 設(shè)置 | 清零 | 刪除","-")

  html = replace(html,"cellspacing=""0"" cellpadding=""0""","cellspacing=""1"" cellpadding=""1""")

  re.pattern = "<span style=""float:right;padding-top:5px; padding-left:8px;""></span></div>       </div>(.*)<tr>              <td height=""40"" colspan=""5"" style=""text-align:center;"">如希望繼續(xù)添加站點(diǎn),請點(diǎn)擊此處"

  set p = re.execute(html)

  if p.count > 0 then

    MainUI p(0).submatches(0)

  else


  end if

End Sub

 

'方法名:MainUI

'功  能:友好的顯示處理結(jié)果

'參  數(shù):body     輸出正文內(nèi)容

Sub MainUI(byval body)

  dim html

  body = midtrim(body)

  html = "<html>" & _

         "<head><meta http-equiv=""Content-Type"" content=""text/html;charset=gb2312"">" & _

         "<title>WinHttpRequest DEMO by Miaoqiyuan.cn - 實(shí)時(shí)獲取CNZZ統(tǒng)計(jì)信息</title>" & _

         "<script type=""text/javascript"">" & _

         "function site_data(id){var s = document.createElement('script');s.src = '?act=data&id=' + id;document.getElementsByTagName('head')[0].appendChild(s);}" & _

         "</script>" & _

         "<style type=""text/css"">" & _

         ".list_box{width:900px;background:#666;};" & _

         ".list_box td,.list_box th{background:#FFF;line-height:25px;text-align:center;};" & _

         ".tr-bg4 td,.tr-bg4 th{background:#666;line-height:25px;};" & _

         "</style>" & _

         "</head>" & _

         "<body><center><h1>WinHttpRequest DEMO by Miaoqiyuan.cn</h1><h2>實(shí)時(shí)獲取CNZZ統(tǒng)計(jì)信息</h2><hr />" & _

         body & _

         "</table><hr />Copyright: miaoqiyuan.cn 2011-" & year(now) & "" & _

         "</center></body></html>"

  response.write html

End Sub

 

'入口

select case request("act")

  case "data"

    Call getData()

  case else

    Call Main()

end select






實(shí)時(shí)獲取51.la統(tǒng)計(jì)信息 ASP版









1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283


'=======================================================================

'=            WinHttpRequest演示實(shí)例 - 實(shí)時(shí)獲取51.la統(tǒng)計(jì)信息            =

'=     Copyright (c) 2011 貓七(QQ:77068320) All rights reserverd.      =

'=              請尊重作者勞動(dòng)成果,轉(zhuǎn)載請保留代碼的完整性               =

'=======================================================================

'= 作者:苗啟源(博客:http://www.miaoqiyuan.cn)                          =



'=======================================================================

'=  返回首頁站點(diǎn)列表: winhttprequest_demo_51la.asp                     =

'=  讀取并輸出驗(yàn)證碼: winhttprequest_demo_51la.asp?act=getcode         =

'=  顯示數(shù)據(jù)驗(yàn)證碼框: winhttprequest_demo_51la.asp?act=login           =

'=  驗(yàn)證驗(yàn)證碼并登陸: winhttprequest_demo_51la.asp?act=dologin         =

'=======================================================================

'=  文件名:winhttprequest_demo_51la.asp                               =

'=  功  能:免登陸查看51.la 網(wǎng)站流量統(tǒng)計(jì)信息                             =

'=======================================================================

 

Dim HttpID,AppName,CNZZ_User,CNZZ_Password

HttpID        = 0

AppName       = "app_51.la_demo"                      '應(yīng)用程序名前綴,防止感染其他程序Application變量

La51_User     = "myw3demo"                            '51.la賬號(hào)

La51_Password = "la51test"                            '51.la密碼

 

'函數(shù)名:OpenHttp

'功  能:創(chuàng)建Http請求,并返回服務(wù)器處理結(jié)果

'參  數(shù):url          請求地址

'        PostData     請求數(shù)據(jù)包,如果是Get請求,請以SENDTYPE=GET開頭

'        &strlocation 如果是服務(wù)器重定向網(wǎng)址,則返回重定向的地址

'特  點(diǎn):自動(dòng)保存/共享cookies,多次請求能保存登錄狀態(tài),新增二進(jìn)制獲取

Function OpenHttp(byval url,byval PostData,byref strlocation)

    dim xmlhttp,xmlget,bgpos,endpos,sendtype,imgtype,isbinstr

    HttpID = HttpID + 1

    if HttpID > 10 then

      response.write "1,連接次數(shù)過多"

      response.end

    end if

    strlocation = ""

    '與CNZZ的實(shí)例對(duì)比,增加了獲取驗(yàn)證碼的功能

    sendtype = "SENDTYPE=GET"

    imgtype  = "GETTYPE=IMAGE"

    isbinstr = false

    Set xmlhttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")

    xmlhttp.Option(6)=0

    With xmlhttp

      .setTimeouts 200000,200000,200000,200000

      if left(PostData,len(sendtype)) = sendtype or left(PostData,len(imgtype)) = imgtype then

        if left(PostData,len(sendtype)) = sendtype then

          url = url & "?" & replace(PostData,sendtype,"")

        else

          url = url & "?" & replace(PostData,imgtype,"")

          isbinstr = true

        end if

        PostData = ""

        .Open "GET", url , False

      else

        .Open "POST", url, False

      end if

      .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"

      .setRequestHeader "Content-Length",Len(PostData)

      .setRequestHeader "Referer","

      If Application(AppName & "APIOPcookie")<>"" Then .setRequestHeader "COOKIE", Application(AppName & "APIOPcookie")

      .Send PostData

      If InStr(LCase(.GetAllResponseHeaders),"location:") Then

        strlocation = .GetResponseHeader("location")

      end if

      '阿江的Cookies比較變態(tài),有3個(gè)Set-Cookie,因?yàn)檫@個(gè)問題,浪費(fèi)了好幾個(gè)小時(shí)

      If InStr(.GetAllResponseHeaders,"Set-Cookie") Then

          Application(AppName & "APIOPcookie") = getAJiangCookies(.GetAllResponseHeaders)

      End If

      if isbinstr then

        xmlget = .responseBody

      else

        xmlget = bin2str(.responseBody)

      end if

    End With

    set xmlhttp = nothing

    OpenHttp = xmlget

End Function

 

'函數(shù)名:bin2str

'功  能:將2進(jìn)制值轉(zhuǎn)換為GB2312編碼的字符串

'參  數(shù):binstr       要轉(zhuǎn)換的字符

Function bin2str(byval binstr)

    Const adTypeBinary = 1

    Const adTypeText = 2

    Dim BytesStream,StringReturn

    Set BytesStream = Server.CreateObject("ADODB.Stream")

    With BytesStream

    .Type = adTypeText

    .Open

    .WriteText binstr

    .Position = 0

    .Charset = "GB2312"

    .Position = 2

    StringReturn = .ReadText

    .close

    End With

    Set BytesStream = Nothing

    bin2str = StringReturn

End Function

 

'函數(shù)名:getAJiangCookies

'功  能:從http頭中返回多個(gè)cookies值

'參  數(shù):strHeader    HTTP頭

Function getAJiangCookies(byval strHeader)

  dim tmp,ltmp,sck

  tmp = ""

  sck = "Set-Cookie:"

  for each ltmp in split(strHeader,vbCrlf)

    if left(ltmp,len(sck)) = sck then

      if tmp <> "" then tmp = tmp & ";"

      ltmp = mid(ltmp,len(sck) + 2)

      tmp = tmp & split(ltmp,"; ")(0)

    end if

  next

  tmp = tmp & "; expires=Tue, 23-Sep-2014 16:00:00 GMT; path=/"

  getAJiangCookies = tmp

End Function

 

'函數(shù)名:OpenRegExp

'功  能:創(chuàng)建正則對(duì)象,如果已經(jīng)創(chuàng)建,則不重復(fù)創(chuàng)建

'參  數(shù):&re       要?jiǎng)?chuàng)建的正則對(duì)象變量名稱

Function OpenRegExp(byref re)

  if not isobject(re) then

    set re = new RegExp

    re.ignorecase = true

    re.global     = true

  end if

End Function

 

'函數(shù)名:NotLink

'功  能:去掉所有鏈接

'參  數(shù):html      要處理的Html代碼

Function NotLink(byval Html)

  call OpenRegExp(re)

  Html = replace(Html,"</a>","")

  re.pattern = "<a([^<]*)>"

  Html = re.replace(Html,"")

  NotLink = Html

End Function

 

'函數(shù)名:notImage

'功  能:去掉所有圖片標(biāo)簽

'參  數(shù):html      要處理的Html代碼

function notImage(byval Html)

  call OpenRegExp(re)

  re.pattern = "<img([^<]*)>"

  Html = re.replace(Html,"")

  notImage = Html

end function

 

'函數(shù)名:midtrim

'功  能:去掉所有多余的空格

'參  數(shù):html      要處理的Html代碼

Function midtrim(byval s)

  s = trim(s)

  s = replace(s," ","")

  for k = 0 to 50

    s = replace(s,"  "," ")

  next

  midtrim = s

End Function

 

'函數(shù)名:Connect

'功  能:連接51.la并返回處理結(jié)果,如果沒有登錄,自動(dòng)重新登錄


'        str      請求的數(shù)據(jù)

Function Connect(byval act,byval str)

  dim html


  '如果未登錄狀態(tài),則進(jìn)入登錄頁面

  if strlocation = "../login.asp" then

    response.redirect "?act=login"

  elseif strlocation <> "" then

    Connect = strlocation

  else

    Connect = html

  end if

End Function

 

'方法名:getCode

'功  能:獲取驗(yàn)證碼

Sub getCode()

  dim html

  Response.Expires = -9999

  Response.AddHeader "Pragma","no-cache"

  Response.AddHeader "cache-ctrol","no-cache"

  Response.ContentType = "Image/BMP"

  response.binarywrite Connect("user/vcode","GETTYPE=IMAGE")

End Sub

 

'方法名:Main

'功  能:從51.la返回站點(diǎn)列表

Sub Main()

  dim html,pe,pa,pm,re,ra,rm

  html = Connect("user/index","SENDTYPE=GETall=yes")

  html = notImage(html)

  html = notLink(html)

  Call OpenRegExp(re)

  Call OpenRegExp(ra)

  Call OpenRegExp(rm)

  re.pattern = "[\S\s]*點(diǎn)擊“查看統(tǒng)計(jì)報(bào)表”可查看實(shí)時(shí)數(shù)據(jù)。"

  ra.pattern = "\( 合計(jì)當(dāng)前顯示的[\S\s]*"

  rm.pattern = "<div class=""sitelist_o"">[^<]*</div>"

  set pe = re.execute(html)

  set pa = ra.execute(html)

  set pm = rm.execute(html)

  if pe.count = 0 or pa.count = 0  or pm.count = 0 then


  else

    html = re.replace(html,"")

    html = ra.replace(html,"")

    html = rm.replace(html,"")

    html = "<div>" & html & "</div>"

    Call MainUI(html)

  end if

End Sub

 

'方法名:Login

'功  能:獲取登錄界面

Sub Login()

  dim html

  html = "<form action=""?act=dologin"" method=""POST"">" & _

         "第一次訪問的時(shí)候,需要輸入驗(yàn)證碼:" & _

         "<input name=""vcode"" size=""4"" />" & _

         " <img src=""?act=getcode&timer=" & timer() & """ /> " & _

         "<input type=""submit"" value=""提交""/>" & _

         "</form>"

  Call MainUI(html)

End Sub

 

'方法名:doLogin

'功  能:登錄51.la

Sub doLogin()

  dim html,vcode,sendStr

  vcode   = request("vcode")

  sendStr = "uname=" & La51_User & _

            "&upass=" & La51_Password & _

            "&vcode=" & vcode & _

            "&remb=yes"

  html = Connect("login",sendStr)

  if html = "user/" then

    response.redirect "?act=list"

  elseif instr(html,"驗(yàn)證碼不正確") then

    Call MainUI("<a href=""?act=login"">驗(yàn)證碼不正確,請重新登錄</a>")

  else

    Call MainUI("<a href=""?act=login"">賬號(hào)或密碼錯(cuò)誤,請修改配置并重新登錄</a>")

  end if

End Sub

 

'方法名:MainUI

'功  能:友好的顯示處理結(jié)果

'參  數(shù):body     輸出正文內(nèi)容

Sub MainUI(byval body)

  dim html

  body = midtrim(body)

  html = "<html>" & _

         "<head><meta http-equiv=""Content-Type"" content=""text/html;charset=gb2312"">" & _

         "<title>WinHttpRequest DEMO by Miaoqiyuan.cn - 實(shí)時(shí)獲取51.la統(tǒng)計(jì)信息</title>" & _

         "<style type=""text/css"">" & _

         ".sitelist_n{height:35px;width:620px;background:#CCC;color:#000;line-height:35px;text-align:left;text-indent:10px;font-weight:800;}" & _

         ".sitelist_s{height:35px;width:620px;color:#666;line-height:35px;font-size:13px;text-align:left;text-indent:20px;}" & _

         "</style>" & _

         "</head>" & _

         "<body><center><h1>WinHttpRequest DEMO by Miaoqiyuan.cn</h1><h2>實(shí)時(shí)獲取51.la統(tǒng)計(jì)信息</h2><hr />" & _

         body & _

         "<hr />Copyright: miaoqiyuan.cn 2011-" & year(now) & "" & _

         "</center></body></html>"

  response.write html

End Sub

 

'入口

select case request("act")

  case "getcode"

    Call getCode()

  case "login"

    Call Login()

  case "dologin"

    Call doLogin()

  case else

    Call Main()

end select



該文章在 2012/8/20 8:44:33 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場、車隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲(chǔ)管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved