- #include <stdio.h>
-
-
- void lecture (FILE *fichier)
- {
- char buf;
- int ret = 1;
- int tot_lign = -3;
- int cpt = 0;
- if (fichier != NULL)
- printf ("<table border=\"1\" width=\"140%\">");//Mise en page dans un tableau
- printf ("<tr><td>");
- do
- {
- ret = fread(&buf, sizeof(char), 1, fichier);
- printf ("%c", buf);
- if (buf == '\n')
- {
- printf ("</td><td>");
- tot_lign++;
- cpt++;
- if (cpt == 3)
- {
- printf ("</tr><tr><td>");
- cpt = -1;
- }
- }
- }
- while (!feof(fichier));
- printf ("</tr>");
- printf ("</table>");
- printf ("<br><br>");
- printf ("<p><font size=\"4\">");("</font></p>");
- printf ("Le nombre total de fichier est de : %d\n", tot_lign);
- printf ("</font></p>");
- }
-
-
- int main (void)
- {
- FILE *fichier;
- printf ("Content-type : text/html\n\n");
- printf ("<HTML>");
- printf ("<head>");
- printf ("<meta http-equiv=\"Content-Language\" content=\"fr\">");
- printf ("<meta ttp-equiv=\"Content-Type\" content=\"text/html;
- charset=windows-1252\">");
- printf ("<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">");
- printf ("<title>Fichier install.log</title>");
- printf ("<base target=\"bas\">");
- printf ("</head>");
- printf ("<body bgcolor=\"#99CCFF\">");
- printf ("<p align=\"center\"><font color=\"#0000FF\"
- size=\"6\"><i><b>Fichier .log</b></i></font></p><br><br><br>");
- fichier = fopen("install.log", "r"); //ouverture du fichier
- lecture (fichier); //appel de la fonction de lecture
- printf ("</body>");
- printf("</html>");
- fclose (fichier);
- }
#include <stdio.h>
void lecture (FILE *fichier)
{
char buf;
int ret = 1;
int tot_lign = -3;
int cpt = 0;
if (fichier != NULL)
printf ("<table border=\"1\" width=\"140%\">");//Mise en page dans un tableau
printf ("<tr><td>");
do
{
ret = fread(&buf, sizeof(char), 1, fichier);
printf ("%c", buf);
if (buf == '\n')
{
printf ("</td><td>");
tot_lign++;
cpt++;
if (cpt == 3)
{
printf ("</tr><tr><td>");
cpt = -1;
}
}
}
while (!feof(fichier));
printf ("</tr>");
printf ("</table>");
printf ("<br><br>");
printf ("<p><font size=\"4\">");("</font></p>");
printf ("Le nombre total de fichier est de : %d\n", tot_lign);
printf ("</font></p>");
}
int main (void)
{
FILE *fichier;
printf ("Content-type : text/html\n\n");
printf ("<HTML>");
printf ("<head>");
printf ("<meta http-equiv=\"Content-Language\" content=\"fr\">");
printf ("<meta ttp-equiv=\"Content-Type\" content=\"text/html;
charset=windows-1252\">");
printf ("<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">");
printf ("<title>Fichier install.log</title>");
printf ("<base target=\"bas\">");
printf ("</head>");
printf ("<body bgcolor=\"#99CCFF\">");
printf ("<p align=\"center\"><font color=\"#0000FF\"
size=\"6\"><i><b>Fichier .log</b></i></font></p><br><br><br>");
fichier = fopen("install.log", "r"); //ouverture du fichier
lecture (fichier); //appel de la fonction de lecture
printf ("</body>");
printf("</html>");
fclose (fichier);
}