ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
690
690
EMPFEHLEN
-
Hallo ihr Lieben,
ich lese mit flgendem Code ein Verzeichnis aus, worin sich .txt Dateien befinden:
Code :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
<html> <% u_file=trim(request.querystring("u_file")) if u_file = "" then ' Get the top level directory info dir_info = request.servervariables("d:\home\web21\xxx\xxx\xxx-xxx.de\a") ' Get the rest of the directory info without the first / dir_info = dir_info + right(request.servervariables("script_name"),(len(request.servervariables("script_name"))-1)) ' Split the directory info by / g_input=split(dir_info,"/") ' Count the number of splits num_inputted=ubound(g_input)-1 set directory=server.createobject("scripting.filesystemobject") set allfiles=directory.getfolder(server.mappath("../"&g_input(num_inputted))) ' Lists all the files found in the directory For each directoryfile in allFiles.files ' Removes ASP pages from view if (right(directoryfile.name,3)) <> "asp" then set fso = createobject("scripting.filesystemobject") set act = fso.opentextfile(server.mappath(directoryfile.name)) read_text = act.readline act.close %> <a href=<% ' Write out the name of the page response.write request.servervariables("script_name") %>?u_file=<% ' Write out the name of the document response.write server.urlencode(directoryfile.name) %>> <% ' Write out the first line of the document response.write server.htmlencode(read_text) %> </a><br> <% 'End check for any pge other than ASP end if ' End for next loop to list documents next ' End check for querstring input else set fso = createobject("scripting.filesystemobject") ' Check to see if the file in the querystring exists ' (This prevents user input in the address bar from causing errors) if fso.FileExists (server.mappath(u_file)) then ' Open the file and read it set act = fso.opentextfile(server.mappath(u_file)) read_text = act.readall act.close ' Write the contents of the document ot the browser Response.Write "<pre>" & server.htmlencode(read_text) & "</pre>" ' If the file in the querystring does not exist ' Display and eror message else %> There was a problem displaying the requested item<br>Please go <a href=<%= request.servervariables("script_name")%>>back</a> and select again <% ' End check for file existence end if ' End check for querystring value end if %> </span>
Ich möchte nun aber die Ausgabe der jeweiligen Textdatei, also, wenn man draufklickt in die ASP Datei, ausgeben aber gleichzeitig formatiert (Schriftart, Schriftgröße).
Denn momentan wird alles in Times Roman ausgegeben, soll aber in Arila sein.
Wie mache ich das?
Danke
Tep
-
Hi
Formatierung legt man in <head>-Bereich über ein Style-Sheet fest.liebe Grüße, die Luzie
Ähnliche Themen
-
Textdatei formatieren
Von Adrian_ im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 2Letzter Beitrag: 23.07.10, 11:24 -
Datensatz auslesen Date formatieren
Von lll192837465lll im Forum PHPAntworten: 20Letzter Beitrag: 17.02.09, 16:29 -
auslesen einer textdatei und in eine neue textdatei schreiben
Von prinzessin4444 im Forum C/C++Antworten: 3Letzter Beitrag: 10.12.08, 12:01 -
Excelsheet auslesen & formatieren
Von nordi im Forum PHPAntworten: 9Letzter Beitrag: 10.04.08, 19:15 -
Textdatei auslesen
Von LordNikkon im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 3Letzter Beitrag: 12.08.04, 10:28





Zitieren
Login





