tags:

views:

41

answers:

3

Hi all,

I want to create an online quiz website using Silverlight. When the registered users are logged in, they can view and answer the quiz once per page. To proceed to the next question, they must push next button, and the new data downloaded from the server. The previous questions are not cached. Thereby everytime the question is requested, the question will be reloaded from the server again.

My question is how to do my scenario above in silverlight?

Thank you in advance.

A: 

Create the silverlight app to request the questions via a Web Service. As long as you're using a proper web service and not faking it in some way. The browser is not going to cache the webservice response.

Graeme Bradbury
A: 

You could use IsolatedStorage to store some state related info (and you can even encrypt it before you save if you want - it's your storage, do what you want with it). Another way to store state information is to use cookies, here and here.

The "state" information that i refer to is the state and/or progress of your Silverlight app, i.e. you can track where the user got to in the questions, and avoid requesting questions they have already completed. Both of these types of storage can be deleted by the end user, if they know what they are doing. But you shouldn't let that worry you - if they want to cheat, then let them.

slugster
+2  A: 

Now that your intent is clear, you want to prevent discovery of the content in your assembly. The answer is you can't really protect your assembly. In order to run it the client needs to fetch it, if it can be fetched then the would be hacker can get it, trying to limit caching isn't really a prevention.

However the solution is to not put senstive stuff in your assembly to start with. Place code server side to do the sensitive stuff and access that code via a service interface such as WCF or Web services or even plain old XML in XML out posting.

AnthonyWJones
+1 for getting a clear indication of what he wanted. It's a shame you didn't tell him about Silverlight Spy and Reflector just to scare him about how easy that reverse engineering would be :)
slugster