locked
How Can I Handle License in my Silverlight Application RRS feed

  • Question

  • I want To Handle A product key Serial Number, First run (Only one Instance of Application running), And Max Number of Users

    Thursday, October 7, 2010 5:30 AM

Answers

  • Hi Ahmed ,

    about second issue how to set the max number of user first you need to get it ... !! There is no way to get a list of online user using the membership API.  You will need to create a domain service that goes against membership data, and pulls the list you want.  You can use the logic in stored procedure 'aspnet_Membership_GetNumberOfUsersOnline' so you can get user count and control max number of users .

    About first issue License your SL App unfortunately you can't get MAC Address coz of silverlight is Client APP you can use Computer name

            public string GetMachineName()
            {
                return HttpContext.Current.Server.MachineName;
            }
    

    but i don't recommend you to identify a client based on computer name instead of login user 2 Computers can be named with the same name as long as they are not within the same network. So I don't recommend  use Computer name to identify a client. If you do not want to identify a client by login, you can use computer's IP address which is still a better identification than the computer name

    string CustomerIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

    Hope that help

    Best regards,

    Yasser

    Friday, October 8, 2010 10:25 AM
  • Hello kobruleht ,

    you must type your function at server Side not client Side which mean Web application instead of SL Application

    string ComputerName = System.IO.Path.GetDirectoryName(HttpContext.Current.Request.ServerVariables["REMOTE_USER"]);


     

    string ComputerName = HttpContext.Current.Server.MachineName;


     

    you can  get Computer name back to SL app using Function that exists in service

    Hope that help

    best regards

    yasser

    Friday, October 8, 2010 6:20 PM

All replies

  • because Sivlerlight is client technology, you should try and do no validation in silverlight and instead pass off all validation to a web service.

    That way you can keep any encryption keys private.

    As for running one instance it would have to be run in OutOfBrowser mode and even then I am not sure how easy to it would be to trap additional instances, you would have to use the windows API calls.

    Thursday, October 7, 2010 6:31 AM
  • First Thanks for ur care

    Second Can U Explain it with an Example or Tell Me Which words i can Search Under it

    Thursday, October 7, 2010 6:40 AM
  • if you google silverlight out of browser there are lots of articles explaining how it works and how to use it.

    As for the encryption / security you can look for any articles about web based encryption, its not silkverlight specific.

    Sorry I can not give anything more concrete.

    Thursday, October 7, 2010 9:00 AM
  • Hi Ahmed ,

    about second issue how to set the max number of user first you need to get it ... !! There is no way to get a list of online user using the membership API.  You will need to create a domain service that goes against membership data, and pulls the list you want.  You can use the logic in stored procedure 'aspnet_Membership_GetNumberOfUsersOnline' so you can get user count and control max number of users .

    About first issue License your SL App unfortunately you can't get MAC Address coz of silverlight is Client APP you can use Computer name

            public string GetMachineName()
            {
                return HttpContext.Current.Server.MachineName;
            }
    

    but i don't recommend you to identify a client based on computer name instead of login user 2 Computers can be named with the same name as long as they are not within the same network. So I don't recommend  use Computer name to identify a client. If you do not want to identify a client by login, you can use computer's IP address which is still a better identification than the computer name

    string CustomerIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

    Hope that help

    Best regards,

    Yasser

    Friday, October 8, 2010 10:25 AM
  • I tried in SL client

    HttpContext.Current.Server.MachineName

     

    but this returns error that HttpContext does not exist.

    How to get maschine name in SL client ?

    Andrus.

     

    Friday, October 8, 2010 2:38 PM
  • Hello kobruleht ,

    you must type your function at server Side not client Side which mean Web application instead of SL Application

    string ComputerName = System.IO.Path.GetDirectoryName(HttpContext.Current.Request.ServerVariables["REMOTE_USER"]);


     

    string ComputerName = HttpContext.Current.Server.MachineName;


     

    you can  get Computer name back to SL app using Function that exists in service

    Hope that help

    best regards

    yasser

    Friday, October 8, 2010 6:20 PM
  • This is server computer name.

    I asked for a client computer name where SL application runs.

    Andrus.

    Monday, October 11, 2010 4:11 AM
  • Give CryptoLicensing a try. It is a cryptographic licensing engine and supports licensing Silverlight apps.

    Tuesday, October 12, 2010 2:45 AM