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
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "StringBuilder" in [All]

rasapi32

.

    StringBuilder lpszErrorString,  // buffer to hold error string

.

                StringBuilder sb=new StringBuilder(512);

misc

.

public static bool CPAcquireContext(out IntPtr phProv, StringBuilder pszContainer, uint dwFlags, byte[] pVTable){

.

private static extern bool CPAcquireContextCe(out IntPtr phProv, StringBuilder pszContainer, uint dwFlags, byte[] pVTable);

.

private static extern bool CPAcquireContextXp(out IntPtr phProv, StringBuilder pszContainer, uint dwFlags, byte[] pVTable);

credui

.

        StringBuilder user,

.

        StringBuilder domain,

.

    StringBuilder userBuilder = new StringBuilder();

.

    StringBuilder domainBuilder = new StringBuilder();

.

            StringBuilder userName,

.

            StringBuilder password,

.

                            byval UserName as StringBuilder, _

.

                            byval password AS StringBuilder, _

.

  StringBuilder user = new StringBuilder(MAX_USER_NAME);

.

  StringBuilder pwd = new StringBuilder(MAX_PASSWORD);

.

            StringBuilder userName,

.

            StringBuilder password,

.

                            byref UserName as StringBuilder, _

.

                            byref password AS StringBuilder, _

.

  StringBuilder user = new StringBuilder(MAX_USER_NAME);

.

  StringBuilder pwd = new StringBuilder(MAX_PASSWORD);

.

private static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, uint cbAuthBuffer, StringBuilder pszUserName, ref int pcchMaxUserName, StringBuilder pszDomainName, ref int pcchMaxDomainame, StringBuilder pszPassword, ref int pcchMaxPassword);

.

                              ByVal pszUserName As StringBuilder, ByRef pcchMaxUserName As UInt32, _

.

                              ByVal pszDomainName As StringBuilder, ByRef pcchMaxDomainName As UInt32, _

.

                              ByVal pszPassword As StringBuilder, ByRef pcchMaxPassword As UInt32) As <MarshalAs(UnmanagedType.Bool)> Boolean

.

private static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, uint cbAuthBuffer, StringBuilder pszUserName, ref int pcchMaxUserName, StringBuilder pszDomainName, ref int pcchMaxDomainame, StringBuilder pszPassword, ref int pcchMaxPassword);

.

     var usernameBuf = new StringBuilder(100);

.

     var passwordBuf  = new StringBuilder(100);

.

     var domainBuf = new StringBuilder(100);

Constants

.

        ' stringbuilder for converting value to text

.

        Dim winText As New StringBuilder()

.

        winText = New StringBuilder(ptrLength + 1)

kernel32

.

        out StringBuilder TargetBuffer,

.

        StringBuilder[] lpTargetBuffer,

.

        out StringBuilder ExeNameBuffer,

.

        out StringBuilder ConsoleTitle,

.

        [Out] StringBuilder lpConsoleTitle,

.

        [Out] StringBuilder lpBuffer,

.

        [Out] StringBuilder lpCharacter,

.

   [Out] StringBuilder ComputerName, ref uint nSize);

.

        StringBuilder data = new StringBuilder(500);

.

        StringBuilder data = new StringBuilder(500);

.

    public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

    public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);

.

    StringBuilder data = new StringBuilder(500);

.

    StringBuilder data = new StringBuilder(500);

.

    public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

    public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);

.

public static extern int ExpandEnvironmentStrings([MarshalAs(UnmanagedType.LPTStr)] String source, [Out] StringBuilder destination, int size);

.

                                <MarshalAs(UnmanagedType.LPTStr)>lpDst As System.Text.StringBuilder, _

.

static extern IntPtr FindFirstVolume([Out] StringBuilder lpszVolumeName,

.

  Declare Function FindFirstVolumeW Lib "kernel32.dll" (ByVal lpszVolumeName As System.Text.StringBuilder, ByVal cchBufferLength As UInteger) As IntPtr

.

    static extern FindVolumeSafeHandle FindFirstVolume([Out] StringBuilder lpszVolumeName, uint cchBufferLength);

.

    static extern bool FindNextVolume(FindVolumeSafeHandle hFindVolume, [Out] StringBuilder lpszVolumeName, uint cchBufferLength);

.

        StringBuilder volume = new StringBuilder((int)bufferLength, (int)bufferLength);

.

static extern bool FindNextVolume(IntPtr hFindVolume, [Out] StringBuilder

.

   uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer,

.

static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, uint nSize, string[] Arguments);

.

Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As StringBuilder, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer

.

        StringBuilder msgBuilder = new StringBuilder(101);

.

   uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer,

.

    out StringBuilder msgOut,

.

static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, uint nSize, string[] Arguments);

.

Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As StringBuilder, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer

.

static extern int FormatMessage(FORMAT_MESSAGE dwFlags, IntPtr lpSource, int dwMessageId, uint dwLanguageId, out StringBuilder msgOut, int nSize, IntPtr Arguments);

.

       StringBuilder msgOut = new StringBuilder(256);

.

        StringBuilder msgBuilder = new StringBuilder(101);

.

        StringBuilder buffer = new StringBuilder(BUFF_SIZE);

.

        StringBuilder buffer = new StringBuilder(BUFF_SIZE);

.

        StringBuilder buffer = new StringBuilder(BUFF_SIZE);

.

        StringBuilder buffer = new StringBuilder(BUFF_SIZE);

.

        StringBuilder buffer = new StringBuilder(BUFF_SIZE);

.

        [Out] StringBuilder lpBuffer,

.

    [MarshalAs(UnmanagedType.LPWStr)] StringBuilder sbAppUserModelID);

.

            StringBuilder sbName = new StringBuilder((int)cchLen);

.

            sbName = new StringBuilder((int)cchLen);

.

static extern uint GetAtomName(ushort nAtom, [Out] StringBuilder lpBuffer, int nSize);

.

   StringBuilder lpBuffer, ref uint lpnSize);

.

Private Shared Function GetComputerNameEx(ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As StringBuilder, ByRef lpnSize As UInt32) As Boolean

.

        StringBuilder lpBuffer, ref uint lpnSize);

.

        StringBuilder name = new StringBuilder(260);

.

          StringBuilder lpBuffer, ref uint lpnSize);

.

    $str_builder_obj = [System.Text.StringBuilder]::new($size)

.

   StringBuilder lpBuffer, ref uint lpnSize);

.

Private Shared Function GetComputerNameEx(ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As StringBuilder, ByRef lpnSize As UInt32) As Boolean

.

        StringBuilder lpBuffer, ref uint lpnSize);

.

        StringBuilder name = new StringBuilder(260);

.

        out StringBuilder ExeNameBuffer,

.

        StringBuilder lpConsoleTitle,

.

        StringBuilder lpConsoleTitle,

.

    [MarshalAs(UnmanagedType.LPWStr)] StringBuilder sbAppUserModelID);

.

   [Out] StringBuilder lpBuffer);

.

static extern uint GetCurrentDirectoryW(uint nBufferLength, StringBuilder lpBuffer);

.

StringBuilder nameBuffer = new StringBuilder((int)MAX_DEEP_PATH + 3);

.

static extern int GetDateFormat(uint locale, uint dwFlags, ref SystemTime date, string format, StringBuilder sb, int sbSize);

.

        string lpFormat, StringBuilder lpDateStr, int cchDate

.

        StringBuilder sb = new StringBuilder(format.Length + 16);

.

            sb = new StringBuilder(res);

.

   [Out] StringBuilder lpBuffer, uint nSize);

.

   [Out] StringBuilder lpBuffer, out StringBuilder lpFilePart);

.

Shared Function GetFullPathName(ByVal lpFileName As String, ByVal nBufferLength As Int32, <Out()> ByVal lpBuffer As System.Text.StringBuilder, <Out()> ByVal lpFilePart As System.Text.StringBuilder) As Int32

.

StringBuilder sbFull = new StringBuilder(bufsz);          // Full resolved path will go here

.

StringBuilder sbFile = new StringBuilder(bufsz);          // Filename will go here

.

   sbFull = new StringBuilder(bufsz);                 // Re-create objects w/ proper size

.

   sbFile = new StringBuilder(bufsz);                 // "

.

public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

    StringBuilder data = new StringBuilder(500);

.

    public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

    StringBuilder data = new StringBuilder(500);

.

    public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);

.

DO NOT define using a StringBuilder, because only the first string would be returned.

.

static extern uint GetLogicalDriveStrings(uint bufferLength, [Out] StringBuilder buffer);

.

//    [Out] StringBuilder lpBuffer); --- Don't do this!

.

// if we were to use the StringBuilder, only the first string would be returned

.

        StringBuilder lpszLongPath,

.

    StringBuilder builder = new StringBuilder(255);

.

        builder = new StringBuilder(result);

.

    StringBuilder lpFilename,

.

Public Shared Function GetModuleFileName(<[In]> ByVal hModule As IntPtr, <Out()> ByVal lpFilename As StringBuilder, <[In], MarshalAs(UnmanagedType.U4)> ByVal nSize As Integer) As UInteger

.

        StringBuilder fileName = new StringBuilder(255);

.

Dim sbPath As New StringBuilder(255)

.

    Dim sb As New StringBuilder

.

    Dim sb As New StringBuilder

.

   StringBuilder lpReturnedString,

.

                            ByVal lpReturnedString As StringBuilder, _

.

   StringBuilder^ lpReturnedString,

.

To avoid casting of the StringBuilder.Capacity to uint you can also declare the nSize parameter as int.

.

If you need to get all the section names by passing a null lpAppName or all the key names by passing a null lpKeyName, then you'll need to use a technique like is shown for [GetPrivateProfileSection] to handle the double null-terminated result. .NET's marshaler will truncate the StringBuilder at the first null it finds, so to get back the full double null-terminated result string, you have to manage your own memory buffer.

.

An alternative to the technique above is to use a char[] in place of a StringBuilder when you need to obtain all key names or all section names. The char[] will not truncate at the first null it finds.

.

       StringBuilder sb = new StringBuilder(500);

.

     string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);

.

                ByVal lpReturnedString As StringBuilder, _

.

    Dim sb As StringBuilder

.

    sb = New StringBuilder(500)

.

   StringBuilder lpszShortPath,

.

static extern int GetShortPathName(string pathName, System.Text.StringBuilder shortName, int cbShortName);

.

          <MarshalAs(UnmanagedType.LPTStr)> ByVal ShortPath As System.Text.StringBuilder, _

.

   Declare Unicode Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameW" (ByVal longPath As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal ShortPath As System.Text.StringBuilder, <MarshalAs(UnmanagedType.U4)> ByVal bufferSize As Integer) As Integer

.

    System::Text::StringBuilder^ lpszShortPath,

.

    // donĀ“t allocate stringbuilder here but outside of the function for fast access

.

    StringBuilder shortNameBuffer = new StringBuilder((int)bufferSize);

.

    var sb = new StringBuilder(sz + 1);

.

      ByVal ShortPath As System.Text.StringBuilder, _

.

      Dim sb As New System.Text.StringBuilder(1024)

.

static extern uint GetSystemDirectory([Out] StringBuilder lpBuffer,

.

Public Function GetSystemDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _

.

    StringBuilder sbSystemDir = new StringBuilder(256);

.

    StringBuilder pwszLanguagesBuffer,

.

A possibly better type for pwszLanguagesBuffer is Char[] because StringBuilder will end at the first \0 character; which the native API uses as the delimiter for the array elements it returns.

.

    StringBuilder languagesBuffer = new StringBuilder();

.

static extern UInt32 GetSystemWindowsDirectory(StringBuilder sb, UInt32 size);

.

     StringBuilder sb = new StringBuilder(size);

.

public static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);

.

    private static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);

.

    var buffer = new StringBuilder(260); // MAX_PATH

.

   uint uUnique, [Out] StringBuilder lpTempFileName);

.

  static extern uint GetTempFileName(string lpPathName, string lpPrefixString, uint uUnique, [Out] StringBuilder lpTempFileName);

.

    StringBuilder sb = new StringBuilder(260);    

.

   [Out] StringBuilder lpBuffer);

.

   <Out> lpBuffer As StringBuilder) As Integer

.

     Dim tempPath As New StringBuilder(MAX_PATH - 14)

.

     Dim tempName As New StringBuilder(MAX_PATH)

.

    Dim shortPath As New StringBuilder(TempFile.MAX_PATH)

.

static extern int GetTimeFormat(uint locale, uint dwFlags, ref SystemTime time, string format, StringBuilder sb, int sbSize);

.

    StringBuilder volumeNameBuffer,

.

    StringBuilder fileSystemNameBuffer,

.

     ByVal VolumeNameBuffer As System.Text.StringBuilder, _

.

     ByVal FileSystemNameBuffer As System.Text.StringBuilder, _

.

StringBuilder volname = new StringBuilder(261);

.

StringBuilder fsname = new StringBuilder(261);

.

      Dim volname As New System.Text.StringBuilder(MAX_PATH + 1)

.

      Dim fsname As New System.Text.StringBuilder(MAX_PATH + 1)

.

   lpszVolumeMountPoint, [Out] StringBuilder lpszVolumeName,

.

     StringBuilder sb = new StringBuilder(MaxVolumeNameLength);

.

The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test.

.

Updated: VB code now uses IntPtr instead of StringBuilder - see sample below

.

Using StringBuilder for the buffer does not work since this function returns the names as a bunch of strings separated by the null character ('\0'). So StringBuilder would only report the first item. Therefore we store it in a char array, which can later be converted to a bunch of strings.

.

    ' Have to use Pointer to return pathnames, StringBuilder only returns first NULL-terminated string

.

The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test.

.

Updated: VB code now uses IntPtr instead of StringBuilder - see sample below

.

Using StringBuilder for the buffer does not work since this function returns the names as a bunch of strings separated by the null character ('\0'). So StringBuilder would only report the first item. Therefore we store it in a char array, which can later be converted to a bunch of strings.

.

    ' Have to use Pointer to return pathnames, StringBuilder only returns first NULL-terminated stgring

.

static extern uint GetWindowsDirectory(StringBuilder lpBuffer,

.

Public Function GetWindowsDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _

.

     Dim sb As StringBuilder =new StringBuilder(100)

.

   StringBuilder sb = new StringBuilder(MaxPathLength);

.

     StringBuilder sb =new StringBuilder(100);

.

static extern uint GlobalGetAtomName(ushort nAtom, StringBuilder lpBuffer, int nSize);

.

static extern uint GlobalGetAtomName(ushort nAtom, StringBuilder lpBuffer, int nSize);

.

StringBuilder AtomName = new StringBuilder(nSize);

.

    public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);

.

    StringBuilder data = new StringBuilder(500);

. .

static extern IntPtr lstrcat(StringBuilder lpString1, string lpString2);

.

    static extern IntPtr lstrcat(StringBuilder lpString1, string lpString2);

.

        StringBuilder aString = new StringBuilder();

.

[System.Text.StringBuilder]

.

    [Out] StringBuilder lpString1,

.

For those having trouble with StringBuilder, the below sample code uses the alternative IntPtr method.

.

    [Out] StringBuilder lpString1,

.

As usual, using StringBuilder didn't work for me. I've included some sample code using IntPtr instead.

.

   StringBuilder lpWideCharStr, int cchWideChar);

.

   Dim sb As New StringBuilder

.

public static extern uint PackageFamilyNameFromId( PACKAGE_ID packageId, ref uint packageFamilyNameLength, StringBuilder packageFamilyName );

.

    var packageFamilyNameBuilder = new StringBuilder((int)packageFamilyNameLength);

.

static extern long PackageFullNameFromId(ref PACKAGE_ID packageId, ref UInt32 packageFullNameLength, StringBuilder packageFullName);

.

        StringBuilder packageFullName = new StringBuilder(255);

.

static extern uint QueryDosDevice(string lpDeviceName, StringBuilder lpTargetPath, int ucchMax);

.

Public Shared Function QueryDosDevice(lpDeviceName As String, lpTargetPath As System.Text.StringBuilder, ucchMax As Integer) As Integer

.

Use the second signature if you want only the current mapping for the DOS device. The first null-terminated string returned by the function contains the current mapping, and will be automatically read into the StringBuilder.

.

    StringBuilder pathInformation = new StringBuilder(250);

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: