Windows 8 中有什么特殊的API 来挂载ISO 文件吗?
Is there any special API in Windows 8 to Mount ISO files?
如您所知Windows Explorer 允许将 ISO 文件装载到虚拟驱动器。
有什么API可以用来做这个吗?
原生函数调用AttachVirtualDisk
.
但是,如果您像标签建议的那样使用 C#,那么 call out to PowerShell and use its wrapper around that function Mount-DiskImage
可能更容易
using System.Management.Automation;
namespace IsoMountTest
{
internal class Program
{
private static void Main(string[] args)
{
var isoPath = @"C:\Foo\bar.iso";
using (var ps = PowerShell.Create())
{
ps.AddCommand("Mount-DiskImage").AddParameter("ImagePath", isoPath).Invoke();
}
}
}
}
如您所知Windows Explorer 允许将 ISO 文件装载到虚拟驱动器。 有什么API可以用来做这个吗?
原生函数调用AttachVirtualDisk
.
但是,如果您像标签建议的那样使用 C#,那么 call out to PowerShell and use its wrapper around that function Mount-DiskImage
using System.Management.Automation;
namespace IsoMountTest
{
internal class Program
{
private static void Main(string[] args)
{
var isoPath = @"C:\Foo\bar.iso";
using (var ps = PowerShell.Create())
{
ps.AddCommand("Mount-DiskImage").AddParameter("ImagePath", isoPath).Invoke();
}
}
}
}