一个很简单的方法调用问题,解决后马上散分 在线等!

zp_cool 2008-03-11 09:53:02

MSDN上有这么一段:
ProgressBar1.Minimum = AvailableDiskSpace()
请问 AvailableDiskSpace() 如何引用进来
我using System.Resources 不行 是不是要调用.dll ?如果是 因该是什么?
...全文
135 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
wq_leon 2009-06-23
  • 打赏
  • 举报
回复
AvailableDiskSpace();
TotalDiskSpace() ;
只是个例子,具体代码要自己写,英文注释里已经写的很明白了。
红帽小小 2008-03-11
  • 打赏
  • 举报
回复
是不是API里面的
lyq198345 2008-03-11
  • 打赏
  • 举报
回复
去下载个WMSServerTypeLib.dll
或者看看有没有
"%windir%\system32\windows media\server\wmsservertypelib.dll"
把这个引用了试下。
zp_cool 2008-03-11
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 yuanmanguo 的回复:]

搜索 microsoft.windowsmediaservices.dll
然后,添加引用时通过浏览把 dll加到引用.
添加命名空间:
using Microsoft.WindowsMediaServices.Interop;
[/Quote]

搜过了 没有这个dll
zp_cool 2008-03-11
  • 打赏
  • 举报
回复
MSDN原版 也没见如何引用AvailableDiskSpace()
没定义AvailableDiskSpace()方法啊

public void readFiles()
{
// Sets the progress bar's minimum value to a number
// representing the hard disk space before the files are read in.
// You will most likely have to set this using a system call.
// NOTE: The code below is meant to be an example and
// will not compile.
progressBar1.Minimum = AvailableDiskSpace();
// Sets the progress bar's maximum value to a number
// representing the total hard disk space.
// You will most likely have to set this using a system call.
// NOTE: The code below is meant to be an example
// and will not compile.
progressBar1.Maximum = TotalDiskSpace();

// Uses a for loop to iterate through the operations to be
// completed. In this case, five files are to be written
// to the disk, so it will execute the loop 5 times.
for (int i = 1; i<= 5; i++)
{
// Insert code to read a file into memory and update file size.
// Increases the progress bar's value based on the size of
// the file currently being written.
progressBar1.Increment(FileSize);
// Updates the label to show available drive space.
label1.Text = "Current Disk Space Used = " + progressBar1.Value.ToString();
}
}

yuanmanguo 2008-03-11
  • 打赏
  • 举报
回复

搜索 microsoft.windowsmediaservices.dll
然后,添加引用时通过浏览把 dll加到引用.
添加命名空间:
using Microsoft.WindowsMediaServices.Interop;
sjm2003 2008-03-11
  • 打赏
  • 举报
回复
AvailableDiskSpace()
因该是有返回值的事件吧
zp_cool 2008-03-11
  • 打赏
  • 举报
回复
AvailableDiskSpace();
TotalDiskSpace()

因该怎么调用?
zp_cool 2008-03-11
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 ericzhangbo1982111 的回复:]
p.Minimum=1;
这样就可以拉
[/Quote]

不是 我要的是动态 计算磁盘空间大小 不要固定值
ericzhangbo1982111 2008-03-11
  • 打赏
  • 举报
回复
p.Minimum=1;
这样就可以拉
zp_cool 2008-03-11
  • 打赏
  • 举报
回复
楼上的朋友 请问 怎么引用进来?
using System.XX ?
stning 2008-03-11
  • 打赏
  • 举报
回复
点引用,然后就行了。

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧