Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

[PLAIN]Images not viewed when client is not localhost[/PLAIN]

 

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.

tHe pHrEaKy
Posted
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.

tHe pHrEaKy
Posted
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

tHe pHrEaKy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...