public static PtrToStringUtf8 ( |
||
aPtr | ||
return | string |
/// <summary> /// Get the full name for a given network interface. /// </summary> /// <returns>String in the form a.b.c.d (name).</returns> public string FullName() { IntPtr cStr = OhNetNetworkAdapterFullName(iHandle); string name = InteropUtils.PtrToStringUtf8(cStr); Library.Free(cStr); return(name); }
/// <summary> /// Get the name for a given network interface. /// </summary> /// <returns>String containing name of the adapter.</returns> public string Name() { IntPtr cStr = OhNetNetworkAdapterName(iHandle); string name = InteropUtils.PtrToStringUtf8(cStr); // Library.Free(cStr) not necessary because a copy is not allocated by the underlying NetworkAdapter object return(name); }
/// <summary> /// Query the name of the action /// </summary> /// <returns>Action name</returns> public unsafe String Name() { IntPtr str; uint len; ServiceActionGetName(iHandle, &str, &len); return(InteropUtils.PtrToStringUtf8(str, len)); }
/// <summary> /// Query the value of the property /// </summary> /// <returns>String property value</returns> public unsafe String Value() { IntPtr ptr; uint len; ServicePropertyGetValueString(iHandle, &ptr, &len); String str = InteropUtils.PtrToStringUtf8(ptr, len); OhNetFree(ptr); return(str); }
/// <summary> /// Query the value of the property /// </summary> /// <returns>String property value</returns> public unsafe String Value() { IntPtr ptr; uint len; if (ServicePropertyGetValueString(iHandle, &ptr, &len) == -1) { throw new PropertyError(); } String str = InteropUtils.PtrToStringUtf8(ptr, len); OhNetFree(ptr); return(str); }