Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to call my C# code when a user clicks ClickOnce link
 

How to call my C# code when a user clicks ClickOnce link

Hi Everyone,

Weneedto monitor users access to our WinForms app via ClickOnce.
I write now our3 requirements:
Are theypossible? How to code them? I didn't find documentation about them.

We use ClickOnce in the mode that doesn't install the program on the client PC, just downloads and runs it once.

1) When a user clicks the ClickOnce link, My server-side C# code shouldgetan update and decide if to allow or not this user:
If my server code decides to allow it then the ClickOnce normal process should happen.
If my server code decides to not allow it, it should show the user a specific error message.

2) My server-side C# code should get an updatewhen the user finished working with the downloaded application.

3) How to limit the concurrent number of users that run the application?
Can we define it in ClickOnce, IIS or just in my code?
.Net Developer
oferfr  Sunday, June 28, 2009 10:31 AM
You can't do this with ClickOnce; it is not customizable in this way at all.

Also, note that if you are running ClickOnce as "online only", it does, indeed install it. They just have to be able to connect to the online application file in order to run it.

You could put a link on your website that does some kind of code and then invokes the ClickOnce app, but this is outside of the ClickOnce installation.

The only way to do something when the app closes down is to put it in the application code itself.

The only way to limit the number of concurrent users is to keep track of it on the server and have the application call the server for the information on whether it can run or not.

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, July 02, 2009 6:56 AM

Note: the application deployed in ClickOnce shouldn't know about the 3 requirements.
The 3 requirements should be done by a separate code.

Is this possibble?
If not, what other technologies allow this?


.Net Developer
oferfr  Sunday, June 28, 2009 11:09 AM
You can't do this with ClickOnce; it is not customizable in this way at all.

Also, note that if you are running ClickOnce as "online only", it does, indeed install it. They just have to be able to connect to the online application file in order to run it.

You could put a link on your website that does some kind of code and then invokes the ClickOnce app, but this is outside of the ClickOnce installation.

The only way to do something when the app closes down is to put it in the application code itself.

The only way to limit the number of concurrent users is to keep track of it on the server and have the application call the server for the information on whether it can run or not.

RobinDotNet
Click here to visit my ClickOnce blog!
RobinDotNet  Thursday, July 02, 2009 6:56 AM

You can use google to search for other answers

Custom Search

More Threads

• Can a bootloader and its contents be packaged up into one file?
• How to add configuration file in ClickOnce Setup
• How to create a "Language Dialog" in setup projects ?
• Deploying VSTO via clickonce
• Activation failed - The system cannot find the file specified error...
• Setup Build Fails, But Setup Runs
• SmartClient deployment with j# project fails
• COM server not registered
• making a setupfile
• Deploying .net Apps on a machine without .net framework