问题
As you may know Windows Explorer allows to mount ISO files to a virtual drive. Is there any API which can be used to do this?
回答1:
The native function call AttachVirtualDisk.
However, if you are using C# like your tags suggest it may be easier to just 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();
}
}
}
}
来源:https://stackoverflow.com/questions/29582207/is-there-any-special-api-in-windows-8-to-mount-iso-files