Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System.IO.File.Exists
Message
De
25/05/2005 11:45:57
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
System.IO.File.Exists
Divers
Thread ID:
01017546
Message ID:
01017546
Vues:
62
I have a webform that verifies that a .jpg exists before displaying the image in the webform.

This works perfectly on my dev pc with the images on our local file server.

The problem that I have is putting this into our production environment. On the production webserver, the webform never finds the images when they reside on the production file server. But the images are found when they are placed on the local web server drive. Here is an example:

////////////////////////////////
string lc_file1 = "\\\\myserver\\data\\images\\myimage.jpg"; //will not find this
string lc_file2 = "c:\\media\\images\\myimage.jpg"; //this will be found

///This hits the else statement because it can't find the file.
if (System.IO.File.Exists(lc_file1) == true)
{
///perform not found action
}
else
{
///peform found action
}


///This does find the file on the local drive.
if (System.IO.File.Exists(lc_file2) == true)
{
///perform not found action
}
else
{
///peform found action
}
////////////////////////////////

Why does this work on my dev PC when the images reside a file server, but not on my production environment under the same situation?

What am I missing?

Thanks,

Jerry
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform