Images not viewed when client is not localhost

phreaky

Regular
Joined
Dec 7, 2002
Messages
71
Location
Caracas, Venezuela
[FONT=Arial]Images not viewed when client is not localhost[/FONT]

I made a Web Service (using VB) that only receives a number and transforms it to another one (by a formula). Then I created a client for using that service that...depending on which number the service drops (transforms) then it displays an image (one image for each number).

My problem is that I don't know how to display the image when the client is used outside de localhost (the machine that contains the server), because I coded using a button...when is pressed, the parameter (number) goes to the service, the service processes it and drops another number, that number activates an image that can change depending on the number....so, the pseudo-code is something similar to:

if number = xx then
image1.url = file://C:\........\image.jpg
end if

I know the problem is that the URL I'm giving to the machine is pointing to a file in the disc, but... only when I use the client in the machine that contains the picture in the specific location it will work and won't work when the client is used from a remote machine (because the image is in the server), how can I give the URL saying that is a file on the IP address (that's the way I think it would be visible from anywhere)? As you can see, I'm new at .NET, so please, any help would be very important, thanks.
 
wessamzeidan said:
Place your images in your application directory and use a relative path instead...


Well...in fact the images already are in the wwwroot/webservice/ path (I think that should be the path of the service because it's the default created by .NET), and....can you tell me how do I set a "relative path"?, I don't have much idea how to set it. Thanks in advance.
 
No I mean the images should be in the client's application directory.

If the images folder and the webform are in the folder, then the relative path to your images would be "images/myimage.jpg"....
 
wessamzeidan said:
No I mean the images should be in the client's application directory.

If the images folder and the webform are in the folder, then the relative path to your images would be "images/myimage.jpg"....


Perfect!, it worked, thanks very much!! :D
 
Back
Top