大约有 40,000 项符合查询结果(耗时:0.0350秒) [XML]
How do I find out which process is locking a file using .NET?
...viceShortName;
public RM_APP_TYPE ApplicationType;
public uint AppStatus;
public uint TSSessionId;
[MarshalAs(UnmanagedType.Bool)]
public bool bRestartable;
}
[DllImport("rstrtmgr.dll", CharSet = CharSet.Unicode)]
static extern int RmRegisterReso...
How to convert an IPv4 address into a integer in C#?
... ToInt(string addr)
{
// careful of sign extension: convert to uint first;
// unsigned NetworkToHostOrder ought to be provided.
return (long) (uint) IPAddress.NetworkToHostOrder(
(int) IPAddress.Parse(addr).Address);
}
static string ToAddr(long addre...
Is the size of C “int” 2 bytes or 4 bytes?
...t the standard unsigned int requires (at least) sixteen bits of storage:
UINT_MAX 65535 // 2¹⁶ - 1
Thus we can see that unsigned int require (at least) 16 bits, which is where you get the two bytes (assuming CHAR_BIT is 8)... and later when that limit increased...
How do I safely pass objects, especially STL objects, to and from a DLL?
...very basic datatype, so that int will automatically be wrapped to int32_t, uint will be wrapped to uint32_t, etc. This all occurs behind the scenes, thanks to the overloaded = and () operators. I have omitted the rest of the basic type specializations since they're almost entirely the same except fo...
How can I use UIColorFromRGB in Swift?
... Swift version of that function (for getting a UIColor representation of a UInt value):
func UIColorFromRGB(rgbValue: UInt) -> UIColor {
return UIColor(
red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0,
green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0,
...
How to use hex color values
...
Why not use UInt8 instead of asserting that your ints are in range 0...255?
– Richard Venable
Mar 21 '16 at 13:59
6
...
Converting between strings and ArrayBuffers
...; // always utf-8
console.log(enc.encode("This is a string converted to a Uint8Array"));
You then of course use the .buffer parameter on the resulting Uint8Array to convert the underlaying ArrayBuffer to a different view if needed.
Just make sure that the characters in the string adhere to ...
How do you simulate Mouse Click in C#?
...ntion=CallingConvention.StdCall)]
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
//Mouse actions
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private const int MOUSEEVENTF_RIGHTDOWN...
[精华] VC中BSTR、Char和CString类型的转换 - C/C++ - 清泛网 - 专注C/C++及内核技术
...PWSTR /
WCHAR* /
wchar_t*
Right:
BSTR bs = ...; //
//...
UINT len = ::SysStringLen(bs);
// Do not modify the BSTR content by
// C/C++ string functions
LPTSTR sz = new TCHAR[len+1];
_tcsncpy(sz, bs, len);
::SysFreeString(bs);
delete []sz;
Wrong:
BSTR bs = ......
How to get a enum value from string in C#?
...aseKey choice;
if (Enum.TryParse("HKEY_LOCAL_MACHINE", out choice)) {
uint value = (uint)choice;
// `value` is what you're looking for
} else { /* error: the string was not an enum member */ }
Before .NET 4.5, you had to do the following, which is more error-prone and throws an excepti...