| |

VerySource

 Forgot password?
 Register
Search
View: 861|Reply: 9

Asp.net project deployment how to generate a shortcut on the target computer desktop?

[Copy link]

1

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 13:30:01
| Show all posts |Read mode
I made a c # .net project, but I don't know how to generate a shortcut on the target computer when I package it for deployment. . I found a lot on the Internet to generate shortcuts to .exe, and what I want is to point to "http: // localhost / project name / top.aspx"

I have tried adding top.aspx to the web application folder, then generating a shortcut and moving to the user desktop folder. . . And Create a shortcut directly to "http: // localhost / project name / top.aspx" and copy it to the user desktop folder. . No success. .

The homework will be due soon. . Very anxious. . Wangda people quickly inform! !! !!
Reply

Use magic Report

0

Threads

64

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-1-6 15:24:01
| Show all posts
And what I want is to point to "http: // localhost / project name / top.aspx" or something
————————————————————————————————————————
No need. Your teacher feels that the team will not ask you so. Web programs are published to the server, not everyone's desktop.

You don't need to do "package deployment" of desktop programs.
Reply

Use magic Report

1

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 15:39:01
| Show all posts
Just because it's homework. . Instead of posting to the server, it's a stand-alone demo. .

The effect should be similar to the asp.net expert troubleshooting 200 question downloaded from verysource
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 16:21:01
| Show all posts
Yes, in the program folder, select the page of the shortcut you want to set, then right-click to create a shortcut, and then copy it to the desktop folder.
Reply

Use magic Report

1

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 16:57:01
| Show all posts
No, because there are only main output and content files in my web application folder. . How to choose a page?
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 17:12:01
| Show all posts
and many more
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 17:18:01
| Show all posts
First right-click on "Target Computer" to add a user desktop, then select the file in the web application folder,
Create a shortcut and drag it to the user's desktop folder
Reply

Use magic Report

1

Threads

4

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 17:51:01
| Show all posts
Can point to that file. . But it won't open it with ie. . And the connection is "c:\inetpub\wwwroot\..." instead of "http: // localhost / ..."
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-6 18:03:01
| Show all posts
In addition, the virtual directory and port can also be changed during installation. So there is no way to create a shortcut in advance. It can only be created in the program.
But the packaging tool that comes with vs doesn't seem to be implemented
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 18:15:01
| Show all posts
Create an installation class:
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.DirectoryServices;
using System.IO;

public steup ()
{
try
{

string strVirtualDir = Context.Parameter ["assemblypath"]. ToString ();
string [] arrDir = strVirtualDir.Split ('\\');
strVirtualDir = arrDir [arrDir.Length-2];
StreamWriter sw;
string t = "http: //" + System.Net.Dns.GetHostName () + "/" + strVirtualDir + "/";
Ranch
sw = new StreamWriter (File.Open (Environment.GetFolderPath (System.Environment.SpecialFolder.Desktop) .ToString () + "\\Zhuo Fan Information Test System.url", FileMode.Create, FileAccess.Write));

sw.WriteLine ("[InternetShortcut]");

sw.WriteLine ("URL =" + t + "");

sw.WriteLine ("modified = 2329483928383");

sw.Flush ();

sw.Close ();
InstallLibrary.LogoIcon.WriteReg (strRegPath);
//System.Diagnostics.Process.Start("http://bill/webexam/ ");
}
catch (Exception ex)
{
throw ex;
}
}

2. Add the main output of the project to the installation project, and then add it to the custom operation.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list