{\r
public partial class frmDownload : Form\r
{\r
- private Thread downloadThread;\r
+ private readonly Thread downloadThread;\r
private Stream responceStream;\r
private Stream loacalStream;\r
private HttpWebRequest webRequest;\r
responceStream = wcDownload.OpenRead(hbUpdate);\r
loacalStream = new FileStream(tempPath, FileMode.Create, FileAccess.Write, FileShare.None);\r
\r
- int bytesSize = 0;\r
+ int bytesSize;\r
byte[] downBuffer = new byte[2048];\r
\r
long flength = 0;\r
{\r
loacalStream.Write(downBuffer, 0, bytesSize);\r
flength = loacalStream.Length;\r
- this.Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { loacalStream.Length, fileSize });\r
+ Invoke(new UpdateProgessCallback(this.UpdateProgress), new object[] { loacalStream.Length, fileSize });\r
}\r
\r
responceStream.Close();\r
loacalStream.Close();\r
\r
if (flength != fileSize)\r
- this.Invoke(new DownloadFailedCallback(this.downloadFailed));\r
+ Invoke(new DownloadFailedCallback(this.downloadFailed));\r
else\r
- this.Invoke(new DownloadCompleteCallback(this.downloadComplete));\r
+ Invoke(new DownloadCompleteCallback(this.downloadComplete));\r
}\r
catch (Exception)\r
{\r
}\r
catch (Exception exc)\r
{\r
- MessageBox.Show("Integer Conversion Error On Download \n" + exc.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+ MessageBox.Show("Integer Conversion Error On Download \n" + exc, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
}\r
}\r
\r
btn_cancel.Text = "Close";\r
\r
string tempPath = Path.Combine(Path.GetTempPath(), "handbrake-setup.exe");\r
-\r
- Process startInstall = Process.Start(tempPath);\r
+ Process.Start(tempPath);\r
this.Close();\r
Application.Exit();\r
}\r