0

I need to implement a DLL that will take the parameter passed (SessionNumber) and add it to a web address, and then launch the default browser using that address.

I'm having problems getting it to work correctly.

Currently, I have:

namespace WebsiteLaunch
{
    public class LaunchSite
    {
        public LaunchSite(ref string SessionNumber)
        {
            string SessionPassed = SessionNumber;
            string target = "https://www.website.com/sessionHandler.do?" + SessionPassed;

            try
            {
                System.Diagnostics.Process.Start(target);
                SessionNumber = "SUCCESS";
            }
            catch
            {
                SessionNumber = "ERROR";
            }
        }
    }
}

The source compiles fine, but doesn't work successfully when called from another program.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by mcriscolo
0

Does the "ref" value for the variable "SessionNumber" that gets returned to your calling program get set to "ERROR", or does the whole thing blow? If so, you may want to trap the exception to see what its giving you.

try
{
    System.Diagnostics.Process.Start(target);
    SessionNumber = "SUCCESS";
}
catch (Exception ex)
{
    Console.WriteLine("Exception {0}", ex.Message);
    SessionNumber = "ERROR";
}

Edited by mcriscolo: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.