Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "system" in [All]

wlanapi

.
Summary
Enumerates all of the wireless NICs currently plugged into the system.

secur32

.

This 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);

.

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

.

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)> _

.

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)> _

cards

.

using System;

.

using System.Drawing;

.

using System.Runtime.InteropServices;

.

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>

.

  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

.

  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)

.
Summary
This interface describes the API implemented by preview handlers. When a handler for a given file type is installed on a system, the shell or custom apps can use it to display the contents of these files in their window. Preview handlers usually do not allow in-place editing and may not display all the information contained in the file (for example, macros inside Office documents are ignored by their preview handlers)
.

[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
.
Summary
Checks for specified operating systems and operating system features.
.

     /// Equivalent to PlatformID.Win32Windows. Note that none of those systems

.

     /// systems.

.

     /// GetSystemMetrics(SM_REMOTESESSION).

.

     /// successors. Equivalent to GetSystemMetrics(SM_MEDIACENTER).

.

static extern IntPtr PathAddBackslash([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath);

.

Public Function PathAddBackslash(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder) As IntPtr

.

Public Function PathAppend(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder, _

.

static extern string PathBuildRoot([MarshalAs(UnmanagedType.LPTStr)]szRoot As System.Text.StringBuilder,

.

Public Function PathBuildRoot(<MarshalAs(UnmanagedType.LPTStr)>szRoot As System.Text.StringBuilder, _

.

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

.

                      <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)

.
Summary
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.

.

''' Determines whether a path to a file system object such as a file or directory is valid.

.

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())

.

bool System.IO.Directory.Exists(string path)

.

http://msdn.microsoft.com/en-us/library/system.io.directory.exists%28v=vs.110%29.aspx

.

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) {

.

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, _

.

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)

.
Summary
Instructs system edit controls to use AutoComplete to help complete URLs or file system paths.
.

Int32 res = SHAutoComplete(textBox1.Handle, AutoCompleteFlags.SHACF_FILESYSTEM);

.

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 = "\System32\shell32.dll,-4123";

.

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.

.

    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)

odbc32

.
Summary
Provide access to configured user and system Data Source Names (DSN) and installed ODBC drivers
.

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

aygshell

. .
Summary
This function shuts down the system
.

        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.

.
Summary
.

You can call both SystemIdleTimerReset and SHIdleTimerReset to cover a wider range of devices(?)

.

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.

.

    if (System.IO.File.Exists(Path))

msdelta

.

                      ref System.Runtime.InteropServices.ComTypes.FILETIME lpTargetFileTime,

rasapi32

.

    using System;

.

    using System.Runtime.InteropServices;

wininet

.

    Dim s As New System.Text.StringBuilder

.

    ByVal hInternetSession As System.IntPtr,

.

    ByVal lContext As System.IntPtr) As System.IntPtr

.

[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.


 
Access PInvoke.net directly from VS: