Several Issues about Asp.net packaging and deployment)

Source: Internet
Author: User
Open any web page, right-click it, and choose create shortcut. on the desktop, find the shortcut you just created and open it with the text editing software.

String vname = Virtual application directory
String desktop = environment. getfolderpath (environment. specialfolder. Revoke topdirectory );
Streamwriter Sw = new streamwriter (file. Open (desktop + "// shortcut file name. url", filemode. Create, fileaccess. Write ));
Sw. writeline ("[internetshortcut]");
Sw. writeline (string. Format ("url = http: // {0}/{1}/default. aspx", environment. machinename, vname ));
Sw. writeline ("modified = 00b21ce31e06c30199 ");
Sw. writeline ("iconindex = 0 ");
Sw. writeline ("icon file. ICO ");
Sw. Flush ();
Sw. Close ();

Example: Public override void install (system. Collections. idictionary statesaver)
{
Base. Install (statesaver );
Streamwriter sw2 = system. Io. file. createtext (context. Parameters ["des"]. tostring () + "websystem. url ");
// Context. Parameters ["des"]. tostring () is the corresponding desktop address.
String webdirs = context. Parameters ["webdir"]. tostring ();
// The path corresponding to context. Parameters ["webdir"]. tostring (), which is passed as a parameter in the installation project

Int TT = webdirs. lastindexof (@ "/", webdirs. Length-2, webdirs. Length-3 );
Webdirs = webdirs. substring (TT + 1, webdirs. Length-tt-2 );
String URLs = @ "url = http: // localhost/" + webdirs + @ "/default. aspx ";

Sw2.writeline ("[internetshortcut]");
Sw2.writeline (URLs );
Sw2.writeline ("modified = 228928983 ");
Sw2.flush ();
Sw2.close ();
2. Software Encryption or prompt the user to enter the serial number.
Method 1: add the startup dialog box on the user interface. Select the customer information and move it to the installation address. During installation, the user is prompted to enter the serial number. But this is a simple encryption. As long as the sum of the numbers and the division of 7 is equal to 0, the verification is successful.
Method 2: Add Dialog Box A on the user interface. And

Http://community.csdn.net/Expert/topic/4339/4339743.xml? Temp =. 2149011.
2. Software Encryption or prompt the user to enter the serial number.
Method 1: add the startup dialog box on the user interface. Select the customer information and move it to the installation address. During installation, the user is prompted to enter the serial number. But this is a simple encryption. As long as the sum of the numbers and the division of 7 is equal to 0, the verification is successful.
Method 2: 1. Add the startup Dialog Box A on the user interface. 2. Add a custom operation to the installation of a custom operation. 3. Add the installer class to the program for judgment.
3. How do I package the Treeview together when packaging ASP. NET programs?
1) You can put webctrl_client in your own application file directory, but you need to add it in <configuration> In webconfig:
<Configsections>
<Section name = "microsoftwebcontrols" type = "system. configuration. namevaluesectionhandler, system, system. configuration. namevaluesectionhandler, system, version = 1.0.3300.0, culture = neutral, publickeytoken = Taobao"/>
</Configsections>
<Microsoftwebcontrols>
<Add key = "commonfiles" value = "/website/webctrl_client/website 0"/>
</Microsoftwebcontrols>
Address: http://ttyp.cnblogs.com/archive/2005/06/01/165621.html
2) the first method is not good. We recommend that you put webctrl_client in the installation package and copy it to the root directory before the installation program ends, that is, method 3;
'-----------------

// Method 1: the installation is complete during actual running. The installation of Treeview is just getting started. A little out of sync
/* Processstartinfo psi = new processstartinfo ();
PSI. workingdirectory = dir + "// Database ";
PSI. filename = dir + @ "/database/iewebcontrols. MSI ";
PSI. useshellexecute = true; // MSI file, which is not required if EXE is used
Process. Start (PSI );*/
// Method 2: Install iewebcontrols. MSI
/* Process treeprocess = new process ();
Treeprocess. enableraisingevents = true;
Treeprocess. startinfo. useshellexecute = true;
Treeprocess. startinfo. filename = strinstallpath + @ "/iewebcontrols. MSI ";
Treeprocess. Start ();
Treeprocess. waitforexit ();
Treeprocess. Close ();*/
// Method 3: copy a file
String strwebrootpath = directory. getparent (directory. getparent (strinstallpath). tostring (). tostring ();
If (! Directory. exists (strwebrootpath + @ "/webctrl_client "))
{
Directory. Move (strinstallpath + @ "/webctrl_client", strwebrootpath + @ "/webctrl_client ");
}
Http://community.csdn.net/Expert/topic/4285/4285575.xml? Temp =. 8176081.
4. the user is automatically prompted to install the. NET Framework during packaging.

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.