Desktop Functions: Smart Device Functions:
|
Search Results for "system" in [All]wlanapisecur32This may be required because System.Environment.UserDomainName is broken. If the local machine has a user account that is the same name as a logged in domain user (machineName\bob & domainName\bob) UserDomainName returns the machine name, not the domain name.
ByVal userName As System.Text.StringBuilder, ByRef userNameSize As Integer) As Integer
Dim UserName As New System.Text.StringBuilder(1024) [System.Environment.UserName] [System.Environment.UserDomainName]
using System;
using System.Text;
using System.Collections;
using System.Security.Principal;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Net.Sockets;
using HANDLE = System.IntPtr;
byte[] Message = System.Text.Encoding.ASCII.GetBytes("hi there");
Console.WriteLine(System.Text.Encoding.ASCII.GetString(DecryptedBuffer));
DateTime systime = new DateTime(1601, 1, 1, 0, 0, 0, 0); //win32 systemdate
System.Security.Principal.SecurityIdentifier sid = new System.Security.Principal.SecurityIdentifier(data.PSiD); 5: LsaLogonUser
using System;
using System.Runtime.InteropServices;
Network, // Accessing system via network
System.Text.Encoding.GetEncoding(1252).GetBytes(name,0,name.Length,SourceName,0);
throw new System.ComponentModel.Win32Exception();
throw new System.ComponentModel.Win32Exception((int)OSCalls.LsaNtStatusToWinError(status));
throw new System.ComponentModel.Win32Exception((int)OSCalls.LsaNtStatusToWinError(status));
System.IntPtr profileBuffer = IntPtr.Zero;
throw new System.ComponentModel.Win32Exception((int)OSCalls.LsaNtStatusToWinError(status));
public System.Security.Principal.WindowsIdentity BuildIdentity()
System.Security.Principal.WindowsIdentity retVal = new System.Security.Principal.WindowsIdentity(m_hToken);
/// <returns>Returns a <c>System.Security.Principal.WindowsIdentity</c> object</returns>
public static System.Security.Principal.WindowsIdentity CreateIdentityS4U(System.Net.NetworkCredential credential, WinLogonType logonType) System.Security.Principal.WindowsIdentity has a constructor that you can use if you know the user's principal name (UPN). It does not work however for domain\username. comdlg32
Return System.String.Empty
Return System.String.Empty 8: PrintDlg System.Windows.Forms.PrintDialog
Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _ 9: PrintDlgEx System.Windows.Forms.PrintDialog
Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _ cards10: CardsWrappe
using System;
using System.Drawing;
using System.Runtime.InteropServices; 11: CardsWrapper
using System;
using System.Drawing;
using System.Runtime.InteropServices; shlwapi
/// <exception cref="System.IO.FileNotFoundException">Unknown files extension</exception>
''' <exception cref="System.IO.FileNotFoundException">Unknown files extension</exception> 13: ColorHLSToRGB
using System;
using System.Drawing;
using System.Runtime.InteropServices;
static public System.Drawing.Color HLSToColor(int H,int L,int S)
// Convert Hue, Luminance, and Saturation values to System.Drawing.Color structure.
// ColorHLSToRGB returns a Win32 RGB value (0x00BBGGRR). To convert to System.Drawing.Color 14: ColorRGBToHLS
using System;
using System.Drawing;
using System.Runtime.InteropServices;
//Convert System.Drawing.Color structure to HLS.
static public void ColorToHLS(System.Drawing.Color C,ref int H,ref int L,ref int S) 15: IPreviewHandler [System.Runtime.InteropServices.ComImport] You can use this interface to leverage previewers already installed on a system to display a document preview in a Windows Forms app. 16: IsOS
/// Equivalent to PlatformID.Win32Windows. Note that none of those systems
/// systems.
/// GetSystemMetrics(SM_REMOTESESSION).
/// successors. Equivalent to GetSystemMetrics(SM_MEDIACENTER). 17: PathAddBackslash
static extern IntPtr PathAddBackslash([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath);
Public Function PathAddBackslash(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder) As IntPtr 18: PathAppend
Public Function PathAppend(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder, _ 19: PathBuildRoot
static extern string PathBuildRoot([MarshalAs(UnmanagedType.LPTStr)]szRoot As System.Text.StringBuilder,
Public Function PathBuildRoot(<MarshalAs(UnmanagedType.LPTStr)>szRoot As System.Text.StringBuilder, _ 20: PathCombine
Declare Unicode Function PathCombine Lib "shlwapi.dll" Alias "PathCombineW" (<MarshalAs(UnmanagedType.LPTStr)> PathOut As System.Text.StringBuilder, <MarshalAs(UnmanagedType.LPTStr)> PathIn As String, <MarshalAs(UnmanagedType.LPTStr)> More As String) As IntPtr 21: PathCompactPath
<MarshalAs(UnmanagedType.LPTStr)> pszOut As System.Text.StringBuilder,
using System;
using System.Runtime.InteropServices;
using System.Text; System.Windows.Forms.TextRenderer.MeasureText(String, Font, Size, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis);
<MarshalAs(UnmanagedType.LPTStr)> pszOut As System.Text.StringBuilder,
using System;
using System.Runtime.InteropServices;
using System.Text; System.Windows.Forms.TextRenderer.MeasureText(String, Font, Size, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis);
ByVal path As System.Text.StringBuilder, _
ByRef pathLength As System.UInt32, _
Dim myResult As String = (new System.Uri(myUri)).LocalPath 'returns "C:\Temp\foo.txt"
Private Sub pathFromUrlButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pathFromUrlButton.Click
Dim sz As System.UInt32
Dim sb As System.Text.StringBuilder
sb = New System.Text.StringBuilder(INTERNET_MAX_URL_LENGTH) 24: PathFileExists
/// Determines whether a path to a file system object such as a file or directory is valid.
''' Determines whether a path to a file system object such as a file or directory is valid. 25: PathGetArgs
static extern System.Text.StringBuilder PathGetArgs([MarshalAs(UnmanagedType.LPTStr)]string pszPath);
Public Function PathGetArgs(<MarshalAs(UnmanagedType.LPTStr)>pszPath As String) As <MarshalAs(UnmanagedType.LPTStr)> System.Text.StringBuilder
Dim args As New System.Text.StringBuilder(255)
System.Diagnostics.Debug.WriteLine(args.ToString()) 26: PathIsDirectory bool System.IO.Directory.Exists(string path) http://msdn.microsoft.com/en-us/library/system.io.directory.exists%28v=vs.110%29.aspx 27: PathQuoteSpaces
static extern bool PathQuoteSpaces([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpsz);
Public Function PathQuoteSpaces(<MarshalAs(UnmanagedType.LPTStr)>lpsz As System.Text.StringBuilder) As <MarshalAs(UnmanagedType.Bool)> Boolean
public static string GetRelativePath(FileSystemInfo path1, FileSystemInfo path2) {
Func<FileSystemInfo, string> getFullName = delegate(FileSystemInfo path) { 29: PathRemoveArgs
static extern void PathRemoveArgs([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath);
Public sub PathRemoveArgs(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder)
static extern IntPtr PathRemoveBackslash([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath);
Public Function PathRemoveBackslash(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder) As IntPtr
static extern void PathRemoveExtension([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder pszFile);
Public Sub PathRemoveExtension(<MarshalAs(UnmanagedType.LPTStr)>pszFile As System.Text.StringBuilder)
Dim strFile As New system.Text.StringBuilder(255)
System.Diagnostics.Debug.WriteLine(strFile.ToString())
static extern bool PathRenameExtension([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath,
Public Function PathRenameExtension(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder, _ 33: PathStripPath
Public Sub PathStripPath(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder)
Dim strFile As New system.Text.StringBuilder(255)
System.Diagnostics.Debug.WriteLine(strFile.ToString())
<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder, _
Dim sb As New System.Text.StringBuilder(1024)
static extern void PathUnQuoteSpaces([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpsz);
Public Sub PathUnQuoteSpaces(<MarshalAs(UnmanagedType.LPTStr)>lpsz As System.Text.StringBuilder) 36: SHAutoComplete
static extern void SHCreateStreamOnFileEx(string fileName, uint grfmode, uint dwAttributes, bool fCreate, System.Runtime.InteropServices.ComTypes.IStream streamNull, ref System.Runtime.InteropServices.ComTypes.IStream stream); static extern void SHCreateStreamOnFileEx(string fileName, uint grfmode, uint dwAttributes, bool fCreate, System.Runtime.InteropServices.ComTypes.IStream streamNull, ref System.Runtime.InteropServices.ComTypes.IStream stream); string resourcePath = The problem of leaving behind the registry keys: Since the registry key gets stored in HKEY_CURRENT_USER, every different user on a system will have their own preference saved. If you uninstall the program for one user, you'll leave behind the registry keys for the other users. For example, suppose users X and Y have checked the "Do not show me this dialog again" checkbox, and therefore each have the registry key in their HKEY_CURRENT_USER area. Now user X uninstalls the program. The uninstaller must leave behind the registry key for user Y because that user is not logged in. 41: StrCmpLogicalW
Implements System.Collections.Generic.IComparer(Of String).Compare
public static extern long StrFormatByteSize( long fileSize, System.Text.StringBuilder buffer, int bufferSize );
<System.Runtime.InteropServices.DllImport("shlwapi", CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
public static extern long StrFormatByteSize( long fileSize, System.Text.StringBuilder buffer, int bufferSize );
ByVal url As System.Text.StringBuilder, _
ByRef urlLength As System.UInt32, _
Private Sub urlFromPathButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles urlFromPathButton.Click
Dim sz As System.UInt32
Dim sb As System.Text.StringBuilder
sb = New System.Text.StringBuilder(INTERNET_MAX_URL_LENGTH) odbc3244: SQLDataSources Depending on the value of Direction, you may access System DSN, User DSN or both. Since the same DSN name may be used in User and System DSN, watch out for possible duplicate values. Here is a simple function to obtain the Data Source Names installed on the system (this functionality is not available in ODBC.net):
/// Obtains all the ODBC DSNs installed on the system and returns them in a List<string> object.
Private Sub OnGetODBCConnectionNames(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbExpSID.DropDown, cmbImpSid.DropDown This VB.Net code loads a combo box with only the SQL Server related System DSNs. On XP, Win2k and Win2k3, the system DSN's are stored in the registry in aygshell45: ExitWindowsEx
EWX_POWEROFF - Shuts down the system and turns off the power. ""Note:"" This flag is not supported on a Windows Mobile-based Pocket PC.
EWX_REBOOT - Shuts down the system and reboots. Available only at Windows Mobile 5.0 or later. The ExitWindowsEx function returns as soon as it has initiated the shutdown. The shutdown then proceeds asynchronously. Because the function executes asynchronously, a nonzero return value indicates that the shutdown has been initiated. It does not indicate whether the shutdown will succeed. It is possible that the system, the user, or another application will abort the shutdown. 46: SHIdleTimerReset You can call both SystemIdleTimerReset and SHIdleTimerReset to cover a wider range of devices(?) 47: SHSipPreference tells the system to ignore any pending down requests. That is, if SHSipPreference is called with the SIP_DOWN flag, the system sets a timer and after the timer fires, the input panel is lowered. However, if you call SIP_UNCHANGED before the timer fires, then the input panel will stay in its current location. 48: SndPlaySync
if (System.IO.File.Exists(Path)) msdelta49: CreateDeltaW
ref System.Runtime.InteropServices.ComTypes.FILETIME lpTargetFileTime, rasapi3250: RasEnumEntries
using System;
using System.Runtime.InteropServices; wininet
Dim s As New System.Text.StringBuilder 52: InternetConnect
ByVal hInternetSession As System.IntPtr,
ByVal lContext As System.IntPtr) As System.IntPtr 53: InternetDial [System.Runtime.InteropServices.DllImport("Wininet.dll")]
/// Retrieves the connected state of the local system.
/// Local system has a valid connection to the Internet, but it might or might not be currently
/// <description>Local system uses a local area network to connect to the Internet.</description>
/// <description>Local system uses a modem to connect to the Internet.</description>
/// <description>Local system is in offline mode.</description>
/// <description>Local system uses a proxy server to connect to the Internet.</description>
/// <description>Local system has RAS installed.</description>
using System;
using System.Runtime.InteropServices; Try NetworkInterface.GetIsNetworkAvailable() in the the System.Net.NetworkInformation namespace. It returns true when a network is available and false otherwise. See also: http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.getisnetworkavailable(VS.80).aspx. NOTE: this is all new in .NET 2.0!
static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);
ByVal pchCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, ByVal flags As Integer, ByVal reserved As Integer) As _
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean
static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);
static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);
ByVal pchCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, ByVal flags As Integer, ByVal reserved As Integer) As _
<System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean
System.Object nullObject = 0;
System.Object nullObjStr = strTemp; Above signature is not working for x64 systems. See INTERNET_CACHE_ENTRY_INFO for a version that works on both x86 and x64.
Private Sub cmdGetPolicy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetPolicy.Click
'sBuffer = System.Runtime.InteropServices.Marshal.AllocHGlobal(dwBufferLength)
MsgBox("1st Party: There was an error: Code " & CStr(System.Runtime.InteropServices.Marshal.GetLastWin32Error()))
Private Sub cmdSetPolicy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSetPolicy.Click
MsgBox("There was an error: Code " & CStr(System.Runtime.InteropServices.Marshal.GetLastWin32Error())) Cut off search results after 60. Please refine your search. |