Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# を使用して Web サイト上のファイルをダウンロードし、progressBar を使用してそのダウンロード率を表示したいと考えています。次のコードを使用してローカル ファイルのサイズを取得できることはわかっていますが、Web サイトに投稿されたファイルのサイズを知るにはどうすればよいですか?
FileInfo finfo = new FileInfo(strFilePath); int length = (int)finfo.Length;
ダウンロードを開始すると、サーバーはContent-lengthファイルのサイズを示すヘッダーを送信する必要があります。
Content-length