本文整理汇总了C#中Dcb类的典型用法代码示例。如果您正苦于以下问题:C# Dcb类的具体用法?C# Dcb怎么用?C# Dcb使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dcb类属于命名空间,在下文中一共展示了Dcb类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCommStateNative
private void SetCommStateNative(ref Dcb lpDcb)
{
int commErrors = 0;
Comstat comStat = new Comstat(); for (int i = 0; i < CommStateRetries; i++)
{
if (!NativeMethods.ClearCommError(m_Handle, ref commErrors, ref comStat))
{
WinIoError();
}
if (NativeMethods.SetCommState(m_Handle, ref lpDcb))
{
break;
}
if (i == CommStateRetries - 1)
{
WinIoError();
}
}
}
示例2: InitializeDcb
private void InitializeDcb()
{
Dcb dcb = new Dcb();
GetCommStateNative(ref dcb);
log.Info("before dcb flags: "+dcb.Flags);
dcb.Flags &= ~(1u << DcbFlagAbortOnError);
log.Info("after dcb flags: " + dcb.Flags);
SetCommStateNative(ref dcb);
}
示例3: SetCommState
internal static extern bool SetCommState(SafeFileHandle hFile, ref Dcb lpDcb);
示例4: InitializeDcb
private void InitializeDcb()
{
Dcb dcb = new Dcb();
GetCommStateNative(ref dcb);
dcb.Flags &= ~(1u << DcbFlagAbortOnError);
SetCommStateNative(ref dcb);
}
示例5: GetCommState
private static extern bool GetCommState(SafeFileHandle hFile, ref Dcb lpDcb);
示例6: SetCommStateNative
private void SetCommStateNative(ref Dcb lpDcb)
{
var commErrors = 0;
var comStat = new Comstat();
for (var i = 0; i < CommStateRetries; i++)
{
if (!ClearCommError(m_Handle, ref commErrors, ref comStat))
{
WinIoError();
}
if (SetCommState(m_Handle, ref lpDcb))
{
break;
}
if (i == CommStateRetries - 1)
{
WinIoError();
}
}
}