ASp.net打包部署的若干問題 (轉)

  打開任意一個網頁然後右鍵---創建快捷方式在到桌面上找到剛纔那個快捷方式用文本編輯軟件打開看。
   
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框架。 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章