Two tips: C # how to set the automatic program execution at startup | C # How to enable winform hyperlink

Source: Internet
Author: User
You can set the name/value pair value in the registry of the microsft. Win32 namespace.
In the Registry's "HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run"
Storage Application Program The name and path can be used to start the program. Code As follows:

Using System;
Using System. Collections. Generic;
Using System. componentmodel;
Using System. Data;
Using System. drawing;
Using System. text;
Using System. Windows. forms;

Namespace Autorun
{
Public   Partial   Class Form1: Form
{
Public Form1 ()
{
Initializecomponent ();
}
// Set startup
Private   Void Btnset_click ( Object Sender, eventargs E)
{
Microsoft. win32.registry. setvalue ( @" HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run "
, Application. productname, application. startuppath + Application. productname );
}
// C # winform open hyperlink
Private   Void Form1_load ( Object Sender, eventargs E)
{
System. Diagnostics. process. Start ( " Iexplore.exe " , " Http://revit.5d6d.com " );
}
}
}


Source code: http://revit.5d6d.com/thread-896-1-1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.