temporary save images

  • Thread starter Thread starter Mario Krsnic
  • Start date Start date
M

Mario Krsnic

Hello and Merry Christmas!
I flip in my card play some cards using the call "drawimage". These flipped
cards are saved in temporary images on the server: temp1.jpg, temp2.jpg...
Everything works fine if only one user plays. It seems to be better so save
these temp. images on the local pc. How to do it? Is there some other
solution of this problem?
Thanks for your help!
Mario
 
It seems to be better so save these temp. images on the local pc. How to
do it?

You have (almost) no chance of doing this because of security reasons... If
you can save an image onto your users' hard disk, you could also save a WMI
script into their startup folder which deletes files next time they start
their computer...?
Is there some other solution of this problem?

Why does anything need to be saved anywhere...?
 
Mario Krsnic schreef:
I flip in my card play some cards using the call "drawimage". These flipped
cards are saved in temporary images on the server: temp1.jpg, temp2.jpg...
Everything works fine if only one user plays. It seems to be better so save
these temp. images on the local pc. How to do it? Is there some other
solution of this problem?

Why do you generate the images all the time? Generate all the possible
image once... And then for each 'play' you simply generate html that
points to different images? This way, the browser can notice that he has
already downloaded the given image(eg: shadesnine.jpg).. And look it up
in his cache...
 
You don't control this. The browser caches images.

The easiest solution is to use a GUID filename

string s = System.Guid.NewGuid.ToString()
(.Format(""))

(the .Format has some overload which removes {} and -, but I don't remember
it offhand.

s += ".jpg"

something like that.
 
Hello Tim,
Why do you generate the images all the time? Generate all the possible
image once... And then for each 'play' you simply generate html that
points to different images? This way, the browser can notice that he has
already downloaded the given image(eg: shadesnine.jpg).. And look it up in
his cache...
Yes, it is better so. I have implemented it. It works well till the user
refreshes the page... Thank you!
Cheers
Mario
 
Back
Top