<!--#include file="../include/myFunctions.asp"-->
<%
Dim strHTML
Dim fileNameToSave
Dim linkToGrab
fileNameToSave = "D:\Sites\Danny_Testing\tmp\test.txt"
linkToGrab = "http://192.168.100.236/tmp/test.html"
updateFileFromWeb fileNameToSave, linkToGrab ' call the updateFileFrom
Function updateFileFromWeb( fileNameToSave, linkeToGrab )
lastModifiedDate = ShowDateModified( fileNameToSave )
currentDate = Now()
If DateDiff("n", lastModifiedDate, currentDate) > 1 Then ' If the file is one day old, we update it with new content from FirsTrade website (FirstTrade).
strHTML = GrabHTMLPageV1( linkToGrab )
strHTMLResult = ParseBlockString(strHTML,"<!--NAIStart-->", "<!--NAIEnd-->") ' We use the html comment tag for parsing the data.
writeToFile strHTMLResult, fileNameToSave ' Write to file
'Response.Write strHTMLResult
Response.Write "the file just updated."
End if
End Function
Function ShowDateModified(filespec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)
ShowDateModified = f.DateLastModified
End Function
Function ShowDateCreated(filespec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)
ShowDateCreated = f.DateCreated
End Function
Sub writeToFile( str, fileName )
Dim Stuff, myFSO, WriteStuff, dateStamp
dateStamp = Date()
Set myFSO = CreateObject("Scripting.FileSystemObject")
Set WriteStuff = myFSO.OpenTextFile( fileName, 2, True)
WriteStuff.WriteLine( str )
WriteStuff.Close
SET WriteStuff = NOTHING
SET myFSO = Nothing
End Sub
Function ParseBlockString( strFull, strStart, strEnd )
strStartPosition = InStr(1, strFull, strStart)
strEndPosition = InStr(1, strFull, strEnd) + Len(strEnd)
strLength = strEndPosition - strStartPosition // The length between the strStart to strEnd
if strStartPosition = 0 Or strEndPosition = 0 Then
ParseBlockString = "One of Strings (strStartPosition, strEndPosition) not found!"
ElseIf strLength < 1 then // It is not right if the the strStartPosition is bigger than strEndPosition, coz strStartPosition should come first, then strEndPosition comes next.
ParseBlockString = "One of Strings (strStartPosition, strEndPosition) not found!"
Else
ParseBlockString = Mid(strHTML, strStartPosition, strLength)
// ParseBlockString = Server.HTMLEncode( Mid(strHTML, strStartPosition, strLength) ) ' If you would like to encode the html code, use this line
End if
End Function
Function GrabHTMLPageV1(strURL) ' This one works for older ASP
Dim objXmlHttp
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objXmlHttp.Open "GET", strURL, False
objXmlHttp.Send
If Err.Number = 0 Then
If objXmlHttp.Status = 200 Then ' Return header code must be equal to 200
strHTML = objXmlHttp.ResponseText
'GrabHTMLPageV1 = Server.HTMLEncode(strHTML) ' This is for replacing < to < and > to >
GrabHTMLPageV1 = strHTML
Else ' There is an erro
GrabHTMLPageV1 = "either Incorrect URL or " & objXmlHttp.statusText
End if
Else
GrabHTMLPageV1 = Err.Description
End If
Set objXmlHttp = Nothing
End Function
Function GrabHTMLPageV2(strURL) ' This one works for newer ASP
Dim objXML
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET" , strURL , False ,"",""
objXML.Send
If Err.Number = 0 Then
If objXML.Status = 200 then ' Return header code must be equal to 200
GrabHTMLPageV2 = objXML.ResponseText
Else ' There is an erro
GrabHTMLPageV2 = "Incorrect URL"
End if
Else
GrabHTMLPageV2 = Err.Description
End If
Set objXML = Nothing
End Function
%>
Wednesday, September 10, 2008
Grab HTML source code from website, save it to file
Getting the properties and methods available with an object
| Getting the properties and methods available with an object | ||||
I'm unable to instantiate TLI.TLIApplication from TlbInf32.dll
|
ASP write data to file error
Microsoft VBScript runtime error '800a0046'
Permission denied
/test/tmp.asp, line 15
Since the tmp.asp has to WRITE the file to server's file system, it is possible that the location you are trying to save uploaded file may not have WRITE permission for the user IUSR_MachineName. Please contact your website's system administrator to enable both READ and WRITE permissions for the folder where you want to keep (WRITE) uploaded files.
Note: if the error still shows up, make sure you specify the full path of the file in your script.
To output Path Info:
Response.Write Request.ServerVariables("PATH_INFO")
Response.Write Request.ServerVariables("PATH_TRANSLATED")
Permission denied
/test/tmp.asp, line 15
Since the tmp.asp has to WRITE the file to server's file system, it is possible that the location you are trying to save uploaded file may not have WRITE permission for the user IUSR_MachineName. Please contact your website's system administrator to enable both READ and WRITE permissions for the folder where you want to keep (WRITE) uploaded files.
Note: if the error still shows up, make sure you specify the full path of the file in your script.
To output Path Info:
Response.Write Request.ServerVariables("PATH_INFO")
Response.Write Request.ServerVariables("PATH_TRANSLATED")
Windows 2000 Remote Desktop / Remote Control
Windows 2000 Remote Desktop / Remote Control
Are you trying to connect to a Windows 2000 Server? If so, go to start/settings/control panel, select add/remove programs, select add/remove windows components. Scroll down and select Terminal Services. Remote Administration mode will allow a max of 2 concurrent connections. Make sure to giv the users that need to use this the right to log on locally.
Windows 2000 workstation does not have Terminal Services remote access capabilities. You'll have to use a 2rd part remote access product.
I'm not totally certain but I think you need 2000 advance server to be able to connect with the remote desktop.
Anyway, I can recommand to try RealVNC from http://www.realvnc.com
quite good and free.
Are you trying to connect to a Windows 2000 Server? If so, go to start/settings/control panel, select add/remove programs, select add/remove windows components. Scroll down and select Terminal Services. Remote Administration mode will allow a max of 2 concurrent connections. Make sure to giv the users that need to use this the right to log on locally.
Windows 2000 workstation does not have Terminal Services remote access capabilities. You'll have to use a 2rd part remote access product.
I'm not totally certain but I think you need 2000 advance server to be able to connect with the remote desktop.
Anyway, I can recommand to try RealVNC from http://www.realvnc.com
quite good and free.
Tuesday, September 9, 2008
ASP MS SQL - Fractional Truncation error - 80004005
ASP MS SQL - Fractional Truncation error - 80004005
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Fractional truncation
Check if the certain field is set to "not allow null", and assign the value to the field when you are inserting data.
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Fractional truncation
Check if the certain field is set to "not allow null", and assign the value to the field when you are inserting data.
Monday, August 4, 2008
有關 Windows XP 換硬體 (如主機板) 會出現藍色畫面的問題
http://forum.slime.com.tw/thread98951.html 雙核心的部分自己要換核心檔案 別的地方以前有說過 不贅述
http://happywoo.blogspot.com/2008/03/winxp-ghost.html 大陸人寫的工具要不要用再說 反正驅動程式可以在安全模式移掉的都要移掉
http://www.yorkmak.com/ghost.htm 主要就是要換HAL
http://bbs-mychat.com/read.php?fid=220&tid=215589&page=1 還有安全性辨識碼的部分 所謂的sysprep
http://blog.udn.com/luckyhoo/1707042 Microsoft Windows XP 更換硬體不重裝的方式
David: 恩 關鍵字 ACPI GHOST XP 可以找到 如果真的關鍵的話 應該還要加 HAL SYSPREP
http://happywoo.blogspot.com/2008/03/winxp-ghost.html 大陸人寫的工具要不要用再說 反正驅動程式可以在安全模式移掉的都要移掉
http://www.yorkmak.com/ghost.htm 主要就是要換HAL
http://bbs-mychat.com/read.php?fid=220&tid=215589&page=1 還有安全性辨識碼的部分 所謂的sysprep
http://blog.udn.com/luckyhoo/1707042 Microsoft Windows XP 更換硬體不重裝的方式
David: 恩 關鍵字 ACPI GHOST XP 可以找到 如果真的關鍵的話 應該還要加 HAL SYSPREP
True Image Notes
True Image
1. Big parition (Source) to Small partition (destination) is okay as long as the total space of the destination parition is larger than the used space of the source partition.
2. Figure out the difference between "Acronis Bootable Agent" the boot agent and "Acronis True Image Echo Enterprise Server" (After booting from True Image's bootable CD, there are these options)
Acronis Bootable Agent is currently running. Now you can connect to this computer remotely with Acronis True Image Management Console.
3. There are three ways to convert the physical machine to the virtual machine. First way, using VMware converter to cold clone the physical machine. Second way is to use VMware converter to conver the existing *.tib file (true image) to VMware files. Third way is using the True Image built-in tool to convert it to VMware files.
4 剛試用 True Image Echo Enterprise Server with Universal Restore ,好讚
主要是嘗試 Universal Restore 這個功能,它是可以幫助 在 主機 A clone 下來的 image 拿到 主機 B or 其它 主機 上 還原 而 不會 有 藍色畫面 ( Windows XP 系統 換 硬體 / 主機板 時 會有的問題),剛試過,可以成功轉移
我分別在 physical machine and virtual machine restore 都 okay
然後 它 也可以 預先 把 想要另外載入的 drivers ( 如 RAID, SCSI, etc ) 一併包裝一起
David: 這個 就是加inf跟相關驅動程式檔案到系統目錄呀
呵,因為好多年前 曾遇過這樣的問題 (裝好系統的 硬碟 換個主機 就不能用了),然後一直沒有想把它解決,今天睡著睡著 突然 好想來試看看,才意外發現 True Image 的 Universal Restore 這個 add on 有這功能 ^^||
5. some links
http://www.autoit.tw/bbs/viewthread.php?tid=3019
Windows SRV 備援&備份
http://www.google.com/search?hl=zh-TW&q=true+image+vmware&lr=
http://www.ithome.com.tw/itadm/article.php?c=48761
.
1. Big parition (Source) to Small partition (destination) is okay as long as the total space of the destination parition is larger than the used space of the source partition.
2. Figure out the difference between "Acronis Bootable Agent" the boot agent and "Acronis True Image Echo Enterprise Server" (After booting from True Image's bootable CD, there are these options)
Acronis Bootable Agent is currently running. Now you can connect to this computer remotely with Acronis True Image Management Console.
3. There are three ways to convert the physical machine to the virtual machine. First way, using VMware converter to cold clone the physical machine. Second way is to use VMware converter to conver the existing *.tib file (true image) to VMware files. Third way is using the True Image built-in tool to convert it to VMware files.
4 剛試用 True Image Echo Enterprise Server with Universal Restore ,好讚
主要是嘗試 Universal Restore 這個功能,它是可以幫助 在 主機 A clone 下來的 image 拿到 主機 B or 其它 主機 上 還原 而 不會 有 藍色畫面 ( Windows XP 系統 換 硬體 / 主機板 時 會有的問題),剛試過,可以成功轉移
我分別在 physical machine and virtual machine restore 都 okay
然後 它 也可以 預先 把 想要另外載入的 drivers ( 如 RAID, SCSI, etc ) 一併包裝一起
David: 這個 就是加inf跟相關驅動程式檔案到系統目錄呀
呵,因為好多年前 曾遇過這樣的問題 (裝好系統的 硬碟 換個主機 就不能用了),然後一直沒有想把它解決,今天睡著睡著 突然 好想來試看看,才意外發現 True Image 的 Universal Restore 這個 add on 有這功能 ^^||
5. some links
http://www.autoit.tw/bbs/viewthread.php?tid=3019
Windows SRV 備援&備份
http://www.google.com/search?hl=zh-TW&q=true+image+vmware&lr=
http://www.ithome.com.tw/itadm/article.php?c=48761
.
Subscribe to:
Posts (Atom)