temporary save images

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
 
M

Mark Rae

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...?
 
T

Tim Van Wassenhove

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...
 
S

sloan

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.
 
M

Mario Krsnic

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top