麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > HTML > 正文

個人學(xué)習(xí)之作 hta

2020-01-25 19:40:56
字體:
供稿:網(wǎng)友
  1. 這個hta是基于asp操作access數(shù)據(jù)庫實現(xiàn)的,方便存儲個人學(xué)習(xí)資料的一個東西,也是武林網(wǎng)的雛形,好不容易找到了備份,希望大家能喜歡 
  2. 復(fù)制代碼 代碼如下: 
  3. <!-- 
  4. *********************************************************************** 
  5. '*一直想做一個自己用來學(xué)習(xí)的東西,可是一直沒有時間,本想用asp(用netbox)做的。,我一直 
  6. '*想學(xué)習(xí)程序,vb但沒有時間學(xué)習(xí),現(xiàn)在想用c#做一個,但沒有什么時間,偶爾去官方找vbscript發(fā)現(xiàn) 
  7. '*這個不錯的hta于是花了兩三天的時間,做了一個這個,希望大家能喜歡。 
  8. '*Author: dxy(reterry) 
  9. '*version:1.0 
  10. '*QQ: 461478385 
  11. '*Email:[email protected] 
  12. *********************************************************************** 
  13. //--> 
  14. <html> 
  15. <head> 
  16. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  17. <hta:application 
  18.      id="dxymdb" 
  19.   scroll="yes" 
  20.   singleinstance="yes" 
  21. border="thin" 
  22.   windowstate="maximize" 
  23. icon="dxy.ico" 
  24. > 
  25. <title>我的第一個hta程序</title> 
  26. <style type="text/css"> 
  27. <!-- 
  28. BODY 
  29.   scrollbar-face-color : #D8DBDF; 
  30.   scrollbar-highlight-color : #FFFFFF; 
  31.   scrollbar-shadow-color : #C1C6CC; 
  32.   scrollbar-3dlight-color : #ABB1B3; 
  33.   scrollbar-arrow-color : #7F8996; 
  34.   scrollbar-track-color : #F8FAF9; 
  35.   scrollbar-darkshadow-color : #ABB1B3; 
  36. body,td,th { 
  37.  font-size: 10pt; 
  38.  color: #FFFFFF; 
  39. body { 
  40.  background-color: #3a6ead; 
  41. a { 
  42.  font-size: 9pt; 
  43.  color: #000000; 
  44. a:link { 
  45.  text-decoration: none; 
  46.  color: #FFFF33; 
  47. a:visited { 
  48.  text-decoration: none; 
  49.  color: #FFFF33; 
  50. a:hover { 
  51.  text-decoration: none; 
  52.  color: #FFffff; 
  53. a:active { 
  54.  text-decoration: none; 
  55. .style4 {font-weight: bold} 
  56. .b { 
  57.  border-bottom-width: 1px; 
  58.  border-bottom-style: dashed; 
  59.  border-bottom-color: #BFDFFF; 
  60. .style9 {color: #ffff33} 
  61. input { 
  62. font-size:12px; 
  63. --> 
  64. </style> 
  65. </head> 
  66. <script language="vbscript"> 
  67. '加入智能顯示信息條數(shù) 
  68. strComputer = "." 
  69.     Set objWMIService = GetObject("Winmgmts://" & strComputer & "/root/cimv2") 
  70.     Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor") 
  71.     For Each objItem in colItems 
  72.         thewidth = objItem.ScreenWidth 
  73.         theheight = objItem.ScreenHeight 
  74.     Next 
  75. '------------------智能結(jié)速----- 
  76. const adUserClient=3 
  77. sub window_onload() 
  78. dim conn 
  79. set conn=createobject("adodb.connection") 
  80. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  81. set rs=createobject("adodb.recordset") 
  82. rs.cursorlocation=adUserClient 
  83. sql="select * from theclass order by id desc" 
  84. rs.open sql,conn,1,1 
  85. rs.movefirst 
  86. strclasslist="<select onclick=changeclass() name=theclassname>" 
  87. strclassliststrclasslist=strclasslist+"<option value="&chr(34)&chr(34)&">
  88. do until rs.eof 
  89. strclassliststrclasslist=strclasslist&"<option value="&chr(34)&rs.fields.item("class_name")&chr(34)&">"&rs.fields.item("class_name")&"</option>
  90. rs.movenext 
  91. loop 
  92. strclassliststrclasslist=strclasslist&"<option value='其它'>其它</option><option value='全部'>全部</option></select>
  93. classlist.innerHTML=strclasslist 
  94. end sub 
  95. sub changeclass() 
  96. theclass.value=theclassname.value 
  97. if theclass.value="全部" then 
  98. theclass.value="" 
  99. end if 
  100. end sub 
  101. sub addclass() 
  102. classname=inputbox("請輸入你要添加的類別","添加類別") 
  103. if classname="" then 
  104. msgbox "添加的類別不能為空" 
  105. exit sub 
  106. else 
  107. dim conn 
  108. set conn=createobject("adodb.connection") 
  109. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  110. set rs=createobject("adodb.recordset") 
  111. rs.cursorlocation=adUserClient 
  112. //sqla="insert into class(class_name)values("&classname&")" 
  113. rs.open "theclass",conn,3,3 
  114. rs.addnew() 
  115. rs("class_name")=classname 
  116. rs.update 
  117. rs.close 
  118. conn.close 
  119. msgbox classname&"添加成功",0 
  120. end if 
  121. call window_onload 
  122. end sub 
  123. sub delclass() 
  124. if confirm("你真的要刪除嗎?") then 
  125. delclassname=theclassname.value 
  126. if delclassname="" then 
  127. msgbox "要刪除的類別不能為空" 
  128. exit sub 
  129. else 
  130. dim conn 
  131. set conn=createobject("adodb.connection") 
  132. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  133. set rs=createobject("adodb.recordset") 
  134. rs.cursorlocation=adUserClient 
  135. sqld="delete from theclass where class_name="&chr(39)&delclassname&chr(39) 
  136. rs.open sqld,conn,3,3 
  137. msgbox chr(34)&delclassname&chr(34)&"刪除成功",0 
  138. //rs.close 
  139. //conn.close 
  140. end if 
  141. call window_onload 
  142. end if 
  143. end sub 
  144. sub editclass() 
  145. theeditclass=theclassname.value 
  146. reditclass=inputbox("請輸入你要更改后的類別名稱","類別修改") 
  147. if theeditclass="" or reditclass="" then 
  148. exit sub 
  149. else 
  150. dim conn 
  151. set conn=createobject("adodb.connection") 
  152. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  153. set rs=createobject("adodb.recordset") 
  154. rs.cursorlocation=adUserClient 
  155. sqld="update theclass set class_name="&chr(39)&reditclass&chr(39)&" where class_name="&chr(39)&theeditclass&chr(39) 
  156. rs.open sqld,conn,3,3 
  157. msgbox chr(34)&theeditclass&"-->"&reditclass&chr(34)&"成功修改",0 
  158. call window_onload 
  159. rs.close 
  160. conn.close 
  161. end if 
  162. end sub 
  163. sub window_onUnload 
  164. on error resume next 
  165. rs.close 
  166. conn.close 
  167. end sub 
  168. sub quitscript 
  169. on error resume next 
  170. rs.close 
  171. conn.close 
  172. self.close 
  173. end sub 
  174. sub unadd() 
  175. theclass.value="" 
  176. thetitle.value="" 
  177. content.value="" 
  178. theadd.style.display="none" 
  179. end sub 
  180. sub addnews() 
  181. theadd.style.display="block" 
  182. add.disabled=false 
  183. theclass.value=theclassname.value 
  184. getclass=theclass.value 
  185. gettitle=thetitle.value 
  186. getcontent=content.value 
  187. getisgood=isgood.value 
  188. if getisgood="" then 
  189. getisgood=0 
  190. else 
  191. getidgood=1 
  192. end if 
  193. if getclass<>"" and getclass<>"全部" and gettitle<>"" and getcontent<>"" then 
  194. //msgbox gettitle&getcontent 
  195. dim conn 
  196. set conn=createobject("adodb.connection") 
  197. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  198. set rs=createobject("adodb.recordset") 
  199. rs.cursorlocation=adUserClient 
  200. rs.open "list",conn,3,3 
  201. rs.addnew() 
  202. rs("title")=gettitle 
  203. rs("class_name")=getclass 
  204. rs("content")=getcontent 
  205. rs("isgood")=getisgood 
  206. rs.update 
  207. msgbox "恭喜,數(shù)據(jù)添加成功" 
  208. theclass.value="" 
  209. thetitle.value="" 
  210. content.value="" 
  211. end if 
  212. //rs.close 
  213. //conn.close 
  214. end sub 
  215. sub searchits() 
  216. thesearch=searchstr.value 
  217. 'if thesearch<>"" then 
  218. 'theclassname.value="" 
  219. 'end if 
  220. call changeit(1) 
  221. end sub 
  222. sub changeit(thenum) 
  223. theclass.value=theclassname.value 
  224. thename=theclassname.value 
  225. thesearch=searchstr.value 
  226. 'if thename<>"" then searchstr.value="" 
  227. thelist.innerHTML="" 
  228. thecounts.innerHTML="" 
  229. if thename<>"" or thesearch<>"" then 
  230. dim conn 
  231. set conn=createobject("adodb.connection") 
  232. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  233. set rs=createobject("adodb.recordset") 
  234. rs.cursorlocation=adUserClient 
  235. if thesearch="" then 
  236.   if thename="全部" then 
  237.   sql="select id,class_name,title,enter_time from list order by id desc" 
  238.   else 
  239.   sql="select id,class_name,title,enter_time from list where class_name='"&thename&"' order by id desc" 
  240.   end if 
  241. else 
  242.   if thename="" then 
  243.   sql="select distinct id,class_name,title,enter_time from list where (title like '%"&thesearch&"%' or content like '%"&thesearch&"%' or class_name like '%"&thesearch&"%')" 
  244.   else 
  245. sql="select distinct id,class_name,title,enter_time from list where (title like '%"&thesearch&"%' or content like '%"&thesearch&"%' or class_name like '%"&thesearch&"%') and class_name='"&thename&"'
  246.   end if 
  247. end if 
  248. rs.open sql,conn,1,1 
  249. page=trim(thenum) 
  250. if page<>"" then page=cint(page) 
  251. pre=true 
  252. last=true 
  253. if not rs.eof then 
  254. if theheight=600 then 
  255. maxperpage=20 
  256. elseif theheight>600 then 
  257. maxperpage=28 
  258. else 
  259. maxperpage=20 
  260. end if 
  261. rs.pagesize=maxperpage 
  262. thepages=rs.pagecount 
  263. thecount=rs.recordcount 
  264. if page="" and page<1 then 
  265. intpage=1 
  266. pre=false 
  267. else 
  268.    if page>thepages then 
  269.      intpage=thepages 
  270.   last=false 
  271.   else 
  272.     intpage=cint(page) 
  273.  end if 
  274. end if 
  275. themovenum=(intpage-1)*maxperpage 
  276. thecounts.innerHTML="共有<font color='#ffff33'>"&thecount&"</font>條信息[<font color='#ffff33'>"&maxperpage&"</font>條/頁 共<font color='#ffff33'>"&thepages&"</font>頁 當(dāng)前第<font color='#ffff33'>"&page&"</font>頁]" 
  277. rs.movefirst 
  278. if (intpage-1)*maxperpage<thecounts then 
  279. dim bookmark 
  280. bookmark=rs.bookmark 
  281. rs.move themovenum 
  282. end if 
  283. strlist="<table width='80%' align='center' cellpadding='0' cellspacing='1' border=0>" 
  284. for i=1 to maxperpage 
  285. if rs.eof then exit for 
  286. strliststrlist=strlist&"<tr><td height='20' class='b'>[<font color=yellow>"&rs("class_name")&"</font>] "&rs("title")&"  <font color='#f6f6f6'>"&rs("enter_time")&"</font>  <a href='#' onclick=openthecontent("&rs("id")&")>查看</a> <a href='#' onclick=editnews("&rs("id")&")>修改</a> <a href='#' onclick=delthecontent("&rs("id")&")>刪除</a></td></td>
  287. rs.movenext 
  288. if rs.eof then exit for 
  289. next 
  290. strliststrlist=strlist&"</table>
  291. thelist.innerHTML=strlist 
  292. pagelist="第<select name='cpage' onchange=changeit2()>" 
  293. for j=1 to thepages 
  294. if j=intpage then 
  295. pagelistpagelist=pagelist&"<option value="&j&" selected>"&j&"</option>"  
  296. else 
  297. pagelistpagelist=pagelist&"<option value="&j&">"&j&"</option>"  
  298. end if 
  299. next 
  300. pagelistpagelist=pagelist&"</select>頁" 
  301. fenye.innerHTML=pagelist 
  302. call changepage 
  303. else 
  304. thecounts.innerHTML="<font color='#ffff33'>對不起沒有您要的信息</font>" 
  305. end if 
  306. end if 
  307. //rs.close 
  308. //conn.close 
  309. end sub 
  310. sub changeit2() 
  311. thenum=cpage.value 
  312. call changeit(thenum) 
  313. end sub 
  314. sub openthecontent(id) 
  315. theid=id 
  316. if id<>"" then 
  317. id=cint(id) 
  318. end if 
  319. dim conn 
  320. set conn=createobject("adodb.connection") 
  321. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  322. set rs=createobject("adodb.recordset") 
  323. rs.cursorlocation=adUserClient 
  324. sql="select * from list where id="&id&"" 
  325. rs.open sql,conn,1,1 
  326. if not rs.eof then 
  327. theopencontent=rs("content") 
  328. theopencontent=replace(theopencontent,"<","<") 
  329. theopencontent=replace(theopencontent,">",">") 
  330. set diswindow=window.open("about:blank","diswindow") 
  331. diswindow.document.body.style.fontSize="12px" 
  332. diswindow.focus() 
  333. diswindow.document.write("<html><head><scr"+"ipt>function saveit(){strDesktop='C://Documents and Settings//Administrator//桌面';var code=event.srcElement.parentElement.children[0].value;var objfso=new ActiveXObject('Scripting.FileSystemObject');var strname=prompt('請輸入文件名和路',strDesktop+'//temp.vbs');if(strname!=''){var objfile=objfso.CreateTextFile(strname,2,true);objfile.Write(code);objfile.Close();}}function runit(){var code=event.srcElement.parentElement.children[0].value;var newwin=window.open('');newwin.opener=null;newwin.document.write(code);newwin.document.close();}</scr"+"ipt><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>"+rs("title")+"</title><body style='margin:10px' bgcolor='#3a6ead'><table width='700' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td><textarea rows='20' style='width:700; border:1px solid #808080; overflow:hidden;' onmouseover='this.style.posHeight=this.scrollHeight' onpropertychange='this.style.posHeight=this.scrollHeight' onload='this.style.posHeight=this.scrollHeight'>"+theopencontent+"</textarea><br><input type=button value='運行上面的代碼[html]' onclick='runit()'> <input type=button value='保存' onclick='saveit()'></td></tr></table></body></html>") 
  334. diswindow.focus() 
  335. diswindow.document.close() 
  336. end if 
  337. end sub 
  338. sub delthecontent(strid) 
  339. if confirm("你真的要刪除嗎?") then 
  340. id=strid 
  341. if id<>"" then 
  342. id=cint(id) 
  343. end if 
  344. dim conn 
  345. set conn=createobject("adodb.connection") 
  346. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  347. set rs=createobject("adodb.recordset") 
  348. rs.cursorlocation=adUserClient 
  349. sql="delete from list where id="&id&"" 
  350. rs.open sql,conn,3,3 
  351. msgbox "成功刪除" 
  352. else 
  353. exit sub 
  354. end if 
  355. end sub 
  356. sub changepage() 
  357. cpage_l=cint(cpage.length) 
  358. cpage_v=cint(cpage.value) 
  359. cpage_value="<a href='#' onclick='changeit(1)'>首頁</a>  " 
  360. if cpage_v>1 then 
  361. cpage_valuecpage_value=cpage_value&"<a href='#' onclick='changeit("&cpage_v-1&")'>上一頁</a>  " 
  362. end if 
  363. if cpage_v<cpage_l and cpage_v>=1 then 
  364. cpage_valuecpage_value=cpage_value&"<a href='#' onclick='changeit("&cpage_v+1&")'>下一頁</a>  " 
  365. end if 
  366. cpage_valuecpage_value=cpage_value&"<a href='#' onclick='changeit("&cpage_l&")'>尾頁</a>  " 
  367. dispage.innerHTML=cpage_value 
  368. end sub 
  369. sub editnews(strid) 
  370. theadd.style.display="block" 
  371. id=strid 
  372. if id<>"" then 
  373. id=cint(id) 
  374. end if 
  375. dim conn 
  376. set conn=createobject("adodb.connection") 
  377. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  378. set rs=createobject("adodb.recordset") 
  379. rs.cursorlocation=adUserClient 
  380. sql="select * from list where id="&id&"" 
  381. rs.open sql,conn,1,1 
  382. if not rs.eof then 
  383. titlee=rs("title") 
  384. contente=rs("content") 
  385. classname=rs("class_name") 
  386. end if 
  387. theclassname.value=classname 
  388. thetitle.value=titlee 
  389. content.value=contente 
  390. theid1.value=id 
  391. add.disabled=true 
  392. end sub 
  393. sub editsave() 
  394. id=theid1.value 
  395. edittitle=thetitle.value 
  396. editcontent=content.value 
  397. classname=theclass.value 
  398. if id<>"" then 
  399. dim conn 
  400. set conn=createobject("adodb.connection") 
  401. conn.open "provider=microsoft.jet.oledb.4.0;data source=db.mdb" 
  402. set rs=createobject("adodb.recordset") 
  403. rs.cursorlocation=adUserClient 
  404. sql="select id,class_name,title,content from list where id="&id&"" 
  405. rs.open sql,conn,3,3 
  406. rs("class_name")=classname 
  407. rs("title")=edittitle 
  408. rs("content")=editcontent 
  409. rs.update 
  410. if err.number=0 then 
  411. msgbox("數(shù)據(jù)修改成功") 
  412. end if 
  413. end if 
  414. theid1.value="" 
  415. thetitle.value="" 
  416. content.value="" 
  417. 'theclassname.value="" 
  418. theclass.value="" 
  419. theadd.style.display="none" 
  420. add.disabled=false 
  421. call changeit2() 
  422. end sub 
  423. </script> 
  424. <body style="margin:0px; "> 
  425. <table width="98" height="10" border="0" align="center" cellpadding="0" cellspacing="0"> 
  426.   <tr> 
  427.     <td></td> 
  428.   </tr> 
  429. </table> 
  430. <span name="theadd" id="theadd" style="display:none"> 
  431. <table width="760" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px dotted #ffffff "> 
  432.   <tr> 
  433.     <td style="line-height:150%; ">類    別: 
  434.       <input name="theclass" type="text" id="theclass" style="border:1px solid #808080;" size="10" maxlength="50">       
  435.       標(biāo)題: 
  436.       <input name="thetitle" type="text" id="thetitle" size="40" maxlength="200">       
  437.       <input type="button" name="add" value="添加" onClick="addnews"> 
  438.       <input type="button" name="edit" value="修改" onClick="editsave"> 
  439.       <input type="button" name="undo" value="取消" onClick="unadd"> 
  440.       <br> 
  441.       添加內(nèi)容: 
  442.       <span class="style4"> 
  443.       <textarea name="content" rows="15" style="border:1px solid #808080; width:760; work-break:break-all; " ondblclick="content.style.posHeight=content.scrollHeight"></textarea> 
  444.       </span>    <br> 
  445.       是否推薦:<input name="isgood" type="text" size="5"> 
  446.    <br> id值:     
  447.     <input name="theid1" type="text" size="5"></td> 
  448.   </tr> 
  449. </table> 
  450. </span><br> 
  451. <table width="760" height="47" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px dotted #ffffff;"> 
  452.    <tr> 
  453.     <td height="23" align="center"><div align="left"><span class="style9">內(nèi)容列表</span> [ 
  454.       <input type="button" value="添加信息" onClick="addnews"> 
  455.       ] 類別:<span id="classlist"></span> 
  456. <input name="button" type="button" onClick="changeit(1)" value="載入"> 
  457. <input type="button" onClick="addclass" value="添加"'> 
  458.       <input type="button" onClick="delclass" value="刪除"'> 
  459.       <input type="button" onClick="editclass" value="編輯"'> 
  460.       <input type="button" name="Submit" value="退出" onClick="quitscript"'> 
  461.         <input name="searchstr" type="text" id="searchstr"onfocus="searchstr.select()"> 
  462.     <input type="submit" name="Submit" value="搜"onClick="searchits"> 
  463. </div></td> 
  464.   </tr>   
  465.   <tr> 
  466.     <td><hr align="center" width="80%" size="1" noshade style="border:1px solid #ffffff "></td> 
  467.   </tr> 
  468.   <tr> 
  469.     <td align="center"><span id="fenyetop"></span></td> 
  470.   </tr> 
  471.   <tr> 
  472.     <td><span id="thelist"></span></td> 
  473.   </tr> 
  474.   <tr> 
  475.     <td align="center"><span id="thecounts"></span>  <span id="dispage"></span><span id="fenye"></span></td> 
  476.   </tr>    
  477. </table> 
  478. </body> 
  479. </html> 
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 黑人三级毛片 | 国产精品久久久久久影视 | 日本成人在线免费 | 亚洲一级电影在线观看 | 久久久噜噜噜久久熟有声小说 | 91精品国产91| 午夜精品在线视频 | 久久精品中文字幕一区二区三区 | 欧美精品免费一区二区三区 | 欧美日韩亚洲视频 | 中日韩乱码一二新区 | 爽成人777777婷婷 | 国产噜噜噜 | 在线中文字幕不卡 | 97精品视频在线观看 | 黄色羞羞视频在线观看 | 久久久久久久一区 | 日韩中文字幕三区 | 欧美精品久久久久久久久老牛影院 | 亚洲影院在线播放 | 亚洲一区成人在线 | 成人不卡免费视频 | 久久久久久久久久亚洲精品 | 黄a大片 | 成码无人av片在线观看网站 | japanese javhd| 久久久久久久久久久久久久久伊免 | 草久免费 | 欧美精品18videos性欧美 | 国产成人综合在线观看 | 国产在线播放91 | 久久最新网址 | 91av日韩| 国产精品91久久久 | 国产麻豆交换夫妇 | 巨根插入| 日本在线不卡一区二区 | chinese军人gay呻吟 | 91 久久| 日韩黄色免费电影 | 羞羞视频免费网站含羞草 |