CA1060 Move P/Invokes to NativeMethods class Because it is a P/Invoke method, 'UControl.InternetGetConnectedState(out int, int)' should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods. Mega. UControl.xaml.cs 33
要消除警告,只需将您的 P/Invoke
方法添加到下面的类之一(通常是 NativeMethods
)。如果您正在创建一个可重用的库,您应该将它们放在 UnsafeNativeMethods
或 SafeNativeMethods
中。