The second write is related to calling RAR for decompression. Record the problem.
The first time I wrote a Demo, I tried to upgrade and overwrite my website through RAR decompression.
Problems encountered during the first write:
1. In XP, extract and overwrite the directory of the running Asp.net program on the Web (overwrite itself ). Error-"exception: you cannot overwrite yourself in the process
The solution is to create an application domain to solve this problem!
Then, we put the project on the Windows 2003 desktop and called it to decompress the project. However, we don't know what to decompress.
The reason is: the desktop involves multiple user problems, and it is normal to put it on the CDEF disk.
Then, place the project in the other drive of Win 2003 and decompress it normally.
The reason should be: xp iis and Win 2003 IIS have different principles. Xp is a single process, and 2003 is a multi-process.
The second time is the Winform installation package.
By calling RAR to decompress the installation project, the following error occurs:
1. There are spaces in the decompression path, so an error occurred. It took a long time to find out.
The solution is to enclose the path with double quotation marks if it contains spaces.
2. Online command lines do not have backend running parameters
The solution is to search separately and find the "-ibck"
Send the following code:
Code
Public bool WARToFoler (string rarFromPath, string rarToPath)
{
Process rarPro = new Process ();
RarPro. StartInfo. FileName = AppConfig. SoftSetup_WinRARSystemPath;
RarPro. StartInfo. Arguments = string. Format ("x \" {0} \ "\" {1} \ "-o +-r-ibck", rarFromPath, rarToPath );
RarPro. StartInfo. UseShellExecute = false;
RarPro. StartInfo. RedirectStandardInput = true;
RarPro. StartInfo. RedirectStandardOutput = true;
RarPro. StartInfo. RedirectStandardError = true;
RarPro. StartInfo. CreateNoWindow = true;
RarPro. StartInfo. WindowStyle = ProcessWindowStyle. Hidden;
RarPro. OutputDataReceived + = new System. Diagnostics. DataReceivedEventHandler (p_OutputDataReceived );
RarPro. ErrorDataReceived + = new DataReceivedEventHandler (rarPro_ErrorDataReceived );
RarPro. Start (); // Extract
RarPro. BeginOutputReadLine ();
RarPro. BeginErrorReadLine ();
RarPro. WaitForExit ();
RarPro. Dispose ();
Return IsOK;
}
Void rarPro_ErrorDataReceived (object sender, DataReceivedEventArgs e)
{
If (e. Data! = Null & e. Data! = "")
{
OutMsg. Text + = "failed:" + e. Data + "\ r \ n ";
IsOK = false;
}
}
Void p_OutputDataReceived (object sender, System. Diagnostics. DataReceivedEventArgs e)
{
If (e. Data! = Null & e. Data! = "")
{
OutMsg. Text + = "success:" + e. Data + "\ r \ n ";
}
}
I won't get the RAR parameter command. I heard that the help document of the RAR installation directory contains: I cannot open the cracked version.