[英]how to get pdf file size after generating using C#
how to get PDF file size.? 如何获取PDF文件大小。 I am passing direct pdf url ..any idea? 我正在通过直接的pdf网址..任何想法吗? please 请
FileInfo info = new FileInfo("C:\\file.txt");
FileAttributes attributes = info.Attributes;
Console.WriteLine(attributes);
info = new FileInfo("C:\\");
in above code iam not getting file info.. SO please give me idea how to get pdf file size? 在上面的代码中,我没有获取文件信息。.所以请给我一个想法,如何获取pdf文件大小?
Try this, will return the file size in bytes 试试这个,将返回文件大小(以字节为单位)
FileInfo info = new FileInfo("PDF file path");
long size = info.Length
To get file size in C#, you use: 要使用C#获取文件大小,请使用:
long fileSize = (new FileInfo(fileName)).Length;
Is this not working? 这不行吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.