Solved

Winform event handler to capture params from email hyperlink

Posted on 2011-02-18
9
1,155 Views
Last Modified: 2012-05-11
How do I get a Winforms application event handler to receive three parameters from an email (actually, a user clicking something in the email).

my experience is email body contains a hyperlink similar to
http://www.website.com/App/Servlet?paramA=1&paramB=2&paramC=3
a web service receives the values of each of the three parameters and processing them as necessary.

In this case a C#.NET Winforms application needs to receive the three parameters and process them. It is like we are automating the application by sending filter information before it displays a DataGridView. I can format the email hyperlink (or something better) as needed, because I control the creation of the emails.

What C#.NET class should I use to create a handler to receive the parameters, and how do I create inter-process messaging like this?
0
Comment
Question by:tonygallo10
  • 3
  • 2
  • 2
9 Comments
 
LVL 1

Accepted Solution

by:
razisyed earned 500 total points
Comment Utility
This is basically done through a custom url protocol handler and. You can use something like myapp://servlet?paramA=1&paramB=2 which will launch your windows winform app.

Take a look at the following msdn articles explaining how to do it:

http://blogs.msdn.com/b/noahc/archive/2006/10/19/register-a-custom-url-protocol-handler.aspx

http://msdn.microsoft.com/en-us/library/aa767914(VS.85).aspx

0
 

Author Comment

by:tonygallo10
Comment Utility
Sorry. I did not explain that the Winform application may be running already, so I cannot use args[0].

It is okay if a window (with DataGridView) popups up automatically from the Winform application, because the action was caused by the user clicking in the email text.

Somehow, I need to get the Winform app to "listen" for the event caused by a user clicking on hyperlink myapp://servlet?paramA=1&paramB=2 in the email.
0
 
LVL 1

Expert Comment

by:razisyed
Comment Utility
You can actually still use the same. You would have to make your application a single instance application, and then handle the load event that fires when someone clicks and the application is launced again.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:tonygallo10
Comment Utility
command line args are not working, because this is a ClickOnce deployed program see http://www.experts-exchange.com/Software/Development/Management_Debug/Deployment/Q_24433669.html and the blog entry at http://gregdotnet.blogspot.com/2005/12/passing-arguments-to-clickonce.html

Also, I can see problems creating the keys in the registry as I deploy this application to many users who are not administrators on their computer. I stalled in the Microsoft instructions, when i needed to enter the path to the exe in the registry key HKEY_CLASSES_ROOT/TestStatusAlert/shell/open/command

Click Once applications do not have an explicit and consistently (through multiple version updates) available path to the exe.
0
 
LVL 17

Expert Comment

by:ToAoM
Comment Utility
In that case you should look at a different way to distribute your application. Clickonce doesn't fit the requirements of your app.
0
 

Author Comment

by:tonygallo10
Comment Utility
The feature we need to add is just one part of a large application, which has been deployed with ClickOnce. It is the standard deployment strategy of my client. There IT doesn't want to give admin privileges on user desktops, and I agree from a security standpoint.

The one suggestion I have from the experts requires modifying the registry, which requires admin rights. There must be another way.
0
 
LVL 17

Expert Comment

by:ToAoM
Comment Utility
You could create an outlook addin to do it from the mailclient or something similar, but there is no other way to do it by simply clicking a link.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DNS, website, godaddy 6 39
comparing string in C# 3 31
Make a border less form movable 2 10
Do we need servers??? 5 109
A short article about problems I had with the new location API and permissions in Marshmallow
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now