使用C#编程来格式化可移动媒体 [英] Format Removable media with c# programming

查看:35
本文介绍了使用C#编程来格式化可移动媒体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用c#编程来格式化(FAT32)可移动驱动器.在互联网上,我找到了一种方法,但是问题是它打开了通用的Windows格式程序.但是我只想用C#来做,而没有内置的Windows支持.

I want to format (FAT32) removable drive with c# programming. In the internet I found a way, but the problem is that it opens the generic windows format program. But I want to do it with C# only and no built in windows support.

我的方法是:

// FAT32 Format Button click event
[DllImport("shell32.dll")]
static extern uint SHFormatDrive(IntPtr hwnd, uint drive, uint fmtID, uint options);

推荐答案

您可以使用

You can use wmi, there is a method that allow this.

http://msdn.microsoft.com/en-us/library/aa390432%28v = VS.85%29.aspx

这篇关于使用C#编程来格式化可移动媒体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆