博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

asp.net打包部署的若干问题

Posted on 2005-12-08 10:13  gistoy  阅读(3593)  评论(0编辑  收藏  举报
1、  打开任意一个网页然后右键---创建快捷方式在到桌面上找到刚才那个快捷方式用文本编辑软件打开看。
   
string vname=应用程序虚拟目录
string desktop=Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
StreamWriter sw
=new StreamWriter(File.Open(desktop+"\\快捷方式文件名称.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(
"图标文件.ico");
sw.Flush();
sw.Close();
例如:
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()是对应的桌面地址
string webdirs=Context.Parameters["webdir"].ToString();
//Context.Parameters["webdir"].ToString()对应的路径,在安装项目里面作为参数传入

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、软件的加密或者提示用户输入序列号。
方法一、在用户界面中添加启动对话框。选择客户信息并把他移动到安装地址上面。在安装的时候就会提示用户输入序列号。但是这是一个简单的加密。只要各位数相加的和除7等于0即可验证成功。
方法二、在用户界面中添加对话框A。并

http://community.csdn.net/Expert/topic/4339/4339743.xml?temp=.2149011
2、软件的加密或者提示用户输入序列号。
方法一、在用户界面中添加启动对话框。选择客户信息并把他移动到安装地址上面。在安装的时候就会提示用户输入序列号。但是这是一个简单的加密。只要各位数相加的和除7等于0即可验证成功。
方法二、1、在用户界面中添加启动对话框A。2、在自定义操作的安装中添加自定义操作。3、在程序中添加安装程序类进行判断。
3、ASP.NET程序打包的时候如何把TreeView一起打包?
1)、可以把webctrl_client放在自己应用文件目录里,但是需要在WebConfig中设置 在<configuration>下添加:  
<configSections>  
                    <section  name="MicrosoftWebControls"  type="System.Configuration.NameValueSectionHandler,  System,  System.Configuration.NameValueSectionHandler,  System,  Version=1.0.3300.0,  Culture=neutral,  PublicKeyToken=b77a5c561934e089"  />    
 </configSections>    
 <MicrosoftWebControls>    
          <add  key="CommonFiles"  value="/website/webctrl_client/1_0"  />  
 </MicrosoftWebControls>  
原地址:http://ttyp.cnblogs.com/archive/2005/06/01/165621.html
2)、第一种方法有些不好;建议把webctrl_client放到安装包中,在安装程序结束之前拷到根目录,也就是方法三;
'-----------------

//方法1:在实际运行时,整个安装已结束了。而安装TreeView的工作才刚开始。有点不同步
/*ProcessStartInfo psi = new ProcessStartInfo();
psi.WorkingDirectory = dir+"\\database";
psi.FileName = dir + @"\database\iewebcontrols.msi ";
psi.UseShellExecute=true; //msi文件,如是exe不用设
Process.Start(psi);*/
//方法2:安装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();*/
//方法3:文件拷贝
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、在打包的时候自动提示用户安装.net框架。 
    需安装Microsoft Visual Studio .NET 2003 引导程序插件
原地址:http://blog.csdn.net/zhzuo/archive/2005/05/31/385140.aspx