Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Langages serveur > ASP
ASP Forum sur la programmation ASP. Avant de poster : Cours ASP, FAQ ASP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 26/07/2007, 18h27   #1
Invité de passage
 
Inscription : juillet 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : juillet 2007
Messages : 3
Points : 0
Points : 0
Par défaut Afficher des image d'un folder en asp

bonjour je cherche une fonction en ASP qui me permet de faire cela automatiquement

en gros je place les images dans un répertoire et le code me les affiches

http://www.photob.be/series/apero20/index.php

voici mon code php je souhaiterais réaliser la même chose en ASP

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
   1.
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
   2.
        <head>
   3.
           <title>les series | photob.be | Benjamin Brolet | photographe Bruxelles 2006</title>
   4.
 
   5.
           <meta http-equiv="Content-Script-Type" content="text/javascript" />
   6.
           <meta http-equiv="Content-Style-Type" content="text/css" />
   7.
           <meta name="revisit-after" content="6 days" />
   8.
           <meta name="DC.Date.created" scheme="W3CDTF" content="2006-12-26" />
   9.
           <meta name="DC.Date.modified" scheme="W3CDTF" content="2006-12-26" />
  10.
 
  11.
           <style type="text/css" media="screen">
  12.
              * {margin:0;padding:0;border:2;}
  13.
              div#scrolling {background-color: #ffffff; height: 622px; overflow: auto; white-space: nowrap;}
  14.
              div#scrolling img {margin: 0 2px 0 0;}
  15.
 
  16.
           body {
  17.
          background-color: #333333;
  18.
      }
  19.
      </style>
  20.
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
  21.
        <body>
  22.
        <div id="scrolling">
  23.
      <?php foreach(glob("*.jpg" ) as $photoname) {echo "\t\t<img src=\"./$photoname\" alt=\"$photoname\" />\n";} ?>
  24.
        </div>
  25.
        <div id="copy">
  26.
          <div align="center"><img src="/series/copy.jpg" width="630" height="39">
  27.
          </div>
  28.
        </div>
  29.
        </body>
  30.
      </html>
photob.be est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/07/2007, 08h58   #2
Nouveau Membre du Club
 
Inscription : février 2007
Messages : 44
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 44
Points : 35
Points : 35
Bonjour,

Equivalent de
Code :
1
2
<?php foreach(glob("*.jpg" ) as $photoname) {echo "\t\t<img src=\"./$photoname\" alt=\"$photoname\" />\n";} ?>
  24.
en ASP (il te faut utiliser l'objet FSO)
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%
	'ouverture du systeme de fichiers
	Set FSO=Server.createObject("Scripting.FileSystemObject")
 
	'création de l'objet répertoire
	Set Repertoire = FSO.GetFolder("ton_repertoire")
 
	for each Curseur In Repertoire.Files 
		if ucase(right(curseur.name,3)) = "JPG" then 
%>
<img src="<%= Curseur.name%>" alt="<%= Curseur.name%>" />
<%
		end if
	next
%>
En espérant avoir répondu à ta question.

P.S. : Très belles photos sur ton site !
fabien.c est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/07/2007, 09h30   #3
Invité de passage
 
Inscription : juillet 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : juillet 2007
Messages : 3
Points : 0
Points : 0
Fabien, merci beaucoup pour ton aide

Je suis une quiche en code j'ai du mal a voir comment insérer et remplacer le code existant

Voici mon code, si je n'exagère pas tu peux m'insérer ton code dans le mien ? ( pas de sous entendu sexuels hein )

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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
   <head>
      <title>les series | photob.be | Benjamin Brolet | photographe Bruxelles 2006</title>
 
      <meta http-equiv="Content-Script-Type" content="text/javascript" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta name="revisit-after" content="6 days" />
      <meta name="DC.Date.created" scheme="W3CDTF" content="2006-12-26" />
      <meta name="DC.Date.modified" scheme="W3CDTF" content="2006-12-26" />
 
      <style type="text/css" media="screen">
         * {margin:0;padding:0;border:2;}
         div#scrolling {background-color: #ffffff; height: 622px; overflow: auto; white-space: nowrap;}
         div#scrolling img {margin: 0 2px 0 0;}
 
      body {
	background-color: #333333;
}
</style>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
   <body>
   <div id="scrolling">
<?php foreach(glob("*.jpg") as $photoname) {echo "\t\t<img src=\"./$photoname\" alt=\"$photoname\" />\n";} ?>
   </div>
   <div id="copy">
     <div align="center"><img src="/series/copy.jpg" width="630" height="39">
     </div>
   </div>
   </body>
</html>
photob.be est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/07/2007, 16h19   #4
Nouveau Membre du Club
 
Inscription : février 2007
Messages : 44
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 44
Points : 35
Points : 35
Bonjour,

Voici le code en ASP :
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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
   <head>
      <title>les series | photob.be | Benjamin Brolet | photographe Bruxelles 2006</title>
 
      <meta http-equiv="Content-Script-Type" content="text/javascript" />
      <meta http-equiv="Content-Style-Type" content="text/css" />
      <meta name="revisit-after" content="6 days" />
      <meta name="DC.Date.created" scheme="W3CDTF" content="2006-12-26" />
      <meta name="DC.Date.modified" scheme="W3CDTF" content="2006-12-26" />
 
      <style type="text/css" media="screen">
         * {margin:0;padding:0;border:2;}
         div#scrolling {background-color: #ffffff; height: 622px; overflow: auto; white-space: nowrap;}
         div#scrolling img {margin: 0 2px 0 0;}
 
      body {
	background-color: #333333;
}
</style>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
   <body>
   <div id="scrolling">
	<%  'ouverture du systeme de fichiers 
	Set FSO=Server.createObject("Scripting.FileSystemObject") 
	'création de l'objet répertoire
	Set Repertoire = FSO.GetFolder(Server.MapPath("/")) '!!! à adapter suivant le chemin où sont stockées les photos
	for each Curseur In Repertoire.Files
		if ucase(right(curseur.name,3)) = "JPG" then %>
		<img src="./<%= Curseur.name%>" >
		<%  end if 
	next %>  
	</div>
   <div id="copy">
     <div align="center"><img src="/series/copy.jpg" width="630" height="39">
     </div>
   </div>
   </body>
</html>
Bon courage !
fabien.c est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/07/2007, 17h48   #5
Invité de passage
 
Inscription : juillet 2007
Messages : 3
Détails du profil
Informations forums :
Inscription : juillet 2007
Messages : 3
Points : 0
Points : 0
Merci beaucoup Fabien ca marche nickel !
photob.be est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 01/08/2007, 18h12   #6
Nouveau Membre du Club
 
Inscription : février 2007
Messages : 44
Détails du profil
Informations forums :
Inscription : février 2007
Messages : 44
Points : 35
Points : 35
De rien.
fabien.c est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2008, 04h27   #7
Invité de passage
 
Inscription : octobre 2008
Messages : 1
Détails du profil
Informations forums :
Inscription : octobre 2008
Messages : 1
Points : 1
Points : 1
Par défaut RE

Bonjour à vous deux.

Je m'excuse de relancer un sujet un peu ancien :$

Mais j'ai pu constater photob.be que tu utilisais Wordpress. J'aimerais aussi le mettre en place, et j'aimerais savoir comment tu upload tes photos ?

Par ailleurs, j'ai parcouru ton site, il est extraordinaire, vraiment les photos sont superbes.


Merci.
tetard_nc est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 10h24.


 
 
 
 
Partenaires

Hébergement Web