Results 1 to 3 of 3

Thread: Open default browser with parameter

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Posts
    164

    Open default browser with parameter

    Hey,

    I know nothing about C# (VB guy here), so I need a little direction or help. I need to make an executable that opens the user's default browser to a certain page (specfied by a command line parameter). I have to do it this way, because I am working with another old, but very expensive system that allows you to run executables with parameters (driven from the database) but doesn't support much else like linking to web pages.

    I need it to be C# because the users run the executables from the server (no client install) and I can't have any runtimes or any other required installs (like .NET framework).

    In a perfect situation, it would work like this:
    thanks for any pointers or directions,
    -Shurijo

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    PHP Code:
    using System;

    namespace 
    ConsoleApplication1
    {
        
    /// <summary>
        /// Summary description for Class1.
        /// </summary>
        
    class Class1
        
    {
            
    /// <summary>
            /// The main entry point for the application.
            /// </summary>
            
    [STAThread]
            static 
    void Main(string[] args)
            {
                
                try
                {
                    
    System.Diagnostics.Process.Start(args[0]);
                }
                catch(
    Exception e)
                {
                    
    Console.WriteLine(e.Message);
                }
            }
        }


  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    C# always requires the .Net framework. Ask in the C++ forum.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width