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

來源:互聯網
上載者:User
  開啟任意一個網頁然後右鍵---建立捷徑在到案頭上找到剛才那個捷徑用文本編輯軟體開啟看。
   

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架構。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.