[英]What are the best practices on catching COM-exception in C#?
请问,请告诉我如何以正确的方式处理C#中的COM异常? 例如,我正在使用DirectorySearcher
并获取COMException: The server is not operational
。 我该如何处理这个例外? 我可以为COMException
编写一个处理程序,但是我如何识别特定的异常类型? 我应该检查异常消息或HRESULT
吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.