<%@LANGUAGE="VBSCRIPT" CODEPAGE="874"%> เครื่องส่ง FM transmitter kits และ FM transmitters โดย Aerocomm <% 'Pass the name of the file to the function. Function getFileContents(strIncludeFile) Dim objFSO Dim objText Dim strPage 'Instantiate the FileSystemObject Object. Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'Open the file and pass it to a TextStream Object (objText). The '"MapPath" function of the Server Object is used to get the 'physical path for the file. Set objText = objFSO.OpenTextFile(Server.MapPath(strIncludeFile)) 'Read and return the contents of the file as a string. getFileContents = objText.ReadAll objText.Close Set objText = Nothing Set objFSO = Nothing End Function 'The "getFileContents" function should be included at the top 'of the ASP file. '------------------------------------------------------------- 'Declare variables to hold the content of the main page and 'the include file. Dim strMain, strInclude,strIncludeH,strIncludeF,strIncludeM,strCat 'Get the contents of the main page and pass them to the "strMain" 'variable. strMain = getFileContents("BWbroadcastTMain.shtm") If Request.QueryString("catid")= "" Then Response.Redirect("http://www.aerocommthailand.com/Div5/BWbroadcastT.asp") Else strCat = Request.QueryString("catid") + ".shtm" strInclude = getFileContents(strCat) strIncludeH = getFileContents("Header.asp") strIncludeM = getFileContents("Menubar.asp") strIncludeF = getFileContents("Footer.asp") End If strMain = replace(strMain,"",strIncludeH) strMain = replace(strMain,"",strIncludeM) strMain = replace(strMain,"",strInclude) strMain = replace(strMain,"",strIncludeF) 'Use the "Response" Object to "Write" the completed page to the client. Response.Write strMain %>