从C#使用DeviceIoControl和IOCTL [英] Using DeviceIoControl and IOCTLs from C#

查看:703
本文介绍了从C#使用DeviceIoControl和IOCTL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,
我目前在C#项目中工作,需要使用DeviceIoControl().似乎在c#下没有此函数的实现,这正确吗?如果是这种情况,在项目中包括对此函数的调用的最佳方法是什么?最好在解决方案中创建一个单独的项目,如果是这样,那么是否存在用于解决方案/项目类型的链接?

谢谢

Hello,
I'm currently working in a C# project where I require the use of DeviceIoControl().  It seems that there is no implementation of this function under c#, is this correct?  If this is the case what would be the best way of including calls to this function within the project?  Would it be best to create a separate project within the solution, and if so is there a link out there that goes over this type of solution/project? 

Thanks,

Devan

推荐答案

将代码放在单独的C#项目中不会以任何方式使调用该函数更容易.这只会影响代码的模块化.您必须通过两种方式通过P/Invoke调用该函数.

Putting the code in a separate C# project will not in any way make it easier to call the function. It will only affect the modularity of your code. You have to call the function through P/Invoke either way.


这篇关于从C#使用DeviceIoControl和IOCTL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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