Thomas Rupp: Zitate-Fenster

Beitrag lesen

Hi Herb,
da habe ich auch schon ewig rumgesucht und folgende Lösung für unser Intranet (M$ verseucht, benötigt daher IIS 4.0 und das IIS Resource Kit).
Die Komponente ContentRotator sucht aus einer Datei zufällig ein Zitat aus. Ich schreibe das in eine Datei, die beim ersten Aufruf pro Tag neu erstellt wird.
Coding sieht wie folgt aus (ASP):
<%
If Application("TOD") <> date() THEN
 ' Aktuellen Tip of the day holen und in Variable TOD schreiben
 Set Tip = Server.CreateObject("IISSample.ContentRotator")
 TOD = Tip.ChooseContent("/Zitat.txt")
 Set Tip = Nothing
 ' Tip of the day in die Ausgabedatei schreiben
 Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
 Set objTStream = objFSO.CreateTextFile("E:/TOD.txt", TRUE, FALSE)
 objTStream.WriteLine TOD
 objTStream.Close
 Set objFSO = Nothing
 Set objTStream = Nothing
 Application("TOD") = date()
END IF
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTStream = objFSO.OpenTextFile("E:/TOD.txt")
Tip = objTStream.readAll()
Set objFSO = Nothing
Set objTStream = Nothing
Resonse.Write(Tip)
%>

Hope this helps
Thomas