Note that there are some explanatory texts on larger screens.

plurals
  1. POC# remote stream for file transfer does not read
    primarykey
    data
    text
    <p>i have written a little "Update Programm" to keep an .exe up to date for the rest of my dev team. It used to work fine, but suddenly it stopped working.</p> <p>I already noticed the problem: my remote stream does not start to read.</p> <pre><code> Uri patch = new Uri("http://********/*********/" + GetVersion().ToString() + ".exe"); Int64 patchsize = PatchSize(patch); var CurrentPath = String.Format("{0}\\", Environment.CurrentDirectory); Int64 IntSizeTotal = 0; Int64 IntRunning = 0; string strNextPatch = (version + ".exe"); using (System.Net.WebClient client = new System.Net.WebClient()) { using (System.IO.Stream streamRemote = client.OpenRead(patch)) { using (System.IO.Stream streamLocal = new FileStream(CurrentPath + strNextPatch, FileMode.Create, FileAccess.Write, FileShare.None)) { int intByteSize = 0; byte[] byteBuffer = new Byte[IntSizeTotal]; while ((intByteSize = streamRemote.Read(byteBuffer, 0, byteBuffer.Length)) &gt; 0) { streamLocal.Write(byteBuffer, 0, intByteSize); IntRunning += intByteSize; double dIndex = (double)(IntRunning); double dTotal = (double)byteBuffer.Length; double dProgressPercentage = (dIndex / dTotal); int intProgressPercentage = (int)(dProgressPercentage * 100); worker.ReportProgress(intProgressPercentage); } streamLocal.Close(); } streamRemote.Close(); </code></pre> <p>GetVersion() only returns the current version number of the current server version of the .exe. The problem lies here:</p> <pre><code>while ((intByteSize = streamRemote.Read(byteBuffer, 0, byteBuffer.Length)) &gt; 0) </code></pre> <p>My streamRemote just does not return any bytes so this while clause is not filled.</p> <p>Any advice for me?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload