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]

netapi32

.

            System.Net.Sockets.AddressFamily.InterNetwork,

.

    System.Windows.Forms.MessageBox.Show ( msg);

.

System.DirectoryServices.ActiveDirectory.Domain.GetCurrentDomain()

.

using HANDLE = System.IntPtr;

.

using DWORD = System.UInt32;

.

        iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext);

.

using DWORD = System.UInt32;

.

using ULONG = System.UInt64;

.

    iReturn = DsGetDcOpen("domain1.mydomains.com", 0, null, (System.IntPtr)null, null, 0, out pDcContext);

.

    iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext);

.

internal static extern System.Int32 DsGetDcSiteCoverage(

.

    out System.Int64 EntryCount,

.

        Policies = new string[9, 2] { { "System", "" }, { "Logon", "" }, { "Object Access", "" }, { "Privilige Use", "" }, { "Detailed Tracking", "" }, { "Policy Change", "" }, { "Account Management", "" }, { "Directory Service Access", "" }, { "Account Logon", "" } };

.

        LSA_UNICODE_STRING aSystemName = new LSA_UNICODE_STRING();

.

        aSystemName.SetTo(this.ResourceName);

.

        uint aOpenPolicyResult = LsaOpenPolicy(ref aSystemName, ref aObjectAttributes, aAccess, out aPolicyHandle);

.
Summary
The NetDfsAdd function creates a new Distributed File System (Dfs) link or adds targets to an existing link in a Dfs root.
.

    /// The NetDfsEnum function enumerates all the Distributed File System (Dfs) links in the named Dfs root. The function returns information about the Dfs links based on information specified by the Level parameter.

.

    /// <param name="Buffer">[out] Pointer to the address of a buffer that receives the requested information structures. The format of this data depends on the value of the Level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function. </param>

.

    /// <returns>If the function succeeds, the return value is NERR_Success. If no more entries are available to be enumerated, the return value is ERROR_NO_MORE_ITEMS. If the function fails, the return value is a system error code</returns>

.
Summary
The NetDfsGetClientInfo function retrieves information about a Distributed File System (Dfs) root or a link in the named Dfs root. The information represents the current computer's cached copy of the information about the Dfs link.
.
Summary
The NetDfsRemove function removes a target from a Distributed File System (Dfs) link. If the specified target is the last associated with the Dfs link, then the NetDfsRemove function also removes the link
.

    /// The NetDfsRemove function removes a target from a Distributed File System (Dfs) link. If the specified target is the last associated with the Dfs link, then the NetDfsRemove function also removes the link.

.

    /// <returns>If the function succeeds, the return value is NERR_Success. If the function fails, the return value is a system error code</returns>

.

    ''' The NetDfsRemove function removes a target from a Distributed File System (Dfs) link. If the specified target is the last associated with the Dfs link, then the NetDfsRemove function also removes the link.

.

    ''' <returns>If the function succeeds, the return value is NERR_Success. If the function fails, the return value is a system error code</returns>

.
Summary
The NetDfsSetInfo function sets or modifies the information associated with a Distributed File System (Dfs) link in the named Dfs root, or with the Dfs root itself. The function can set information relevant to a specific root, root target, link, or link target.
.

    /// The NetDfsSetInfo function sets or modifies the information associated with a Distributed File System (Dfs) link in the named Dfs root, or with the Dfs root itself. The function can set information relevant to a specific root, root target, link, or link target.

.

System.DirectoryServices.ActiveDirectory.Domain.GetComputerDomain();

.

Imports System.Runtime.InteropServices

.

If the function fails, the return value can be one of the following error codes or one of the system error codes.

.

Here's some sample code that can do this using System.DirectoryServices

.

        string computerName = SystemInformation.ComputerName;

.

    using System;

.

    using System.Text;

.

    using System.Runtime.InteropServices;

.

        string SystemName,

.

            string SystemName,

.

            string SystemName,

.

    ''' Windows NT:  No special group membership is required to execute the NetMessageBufferSend function on a LAN Manager or a Windows NT system.

.

using System;

.

using System.Runtime.InteropServices;

.

        System.IntPtr UsrBuf = System.IntPtr.Zero;

.

        System.IntPtr item = System.IntPtr.Zero;

.

            if (item != System.IntPtr.Zero)

.

            // Free buffer (allocated by system)

.

            if (UsrBuf != System.IntPtr.Zero)

.

        public System.IntPtr usri1_name;  

.

        public System.IntPtr usri1_comment;  

.

        public System.IntPtr usri1_full_name;  

.

        public System.IntPtr grp_name;

.

        public System.IntPtr grp_comment;

.

        public System.IntPtr usri2_name;

.

        public System.IntPtr usri2_comment;

.

    int Level,     int ResumeHandle,     int EntriesRequested,    int prefMaxLength,    out int entriesRead,     out System.IntPtr Buffer);

.

    [DllImport("netapi32.dll", CharSet=CharSet.Auto, SetLastError=true)] private static extern int NetApiBufferFree (System.IntPtr pBuffer);

.

    System.IntPtr x = System.IntPtr.Zero;

.

            if (x != System.IntPtr.Zero)

.

            if (x != System.IntPtr.Zero)

.

            if (x != System.IntPtr.Zero)

.

            if (x != System.IntPtr.Zero)

.

            if (x != System.IntPtr.Zero)

.

            if (x != System.IntPtr.Zero)

.
Summary
Queries the redirector to retrieve the optional features the remote system supports. Features include Unicode, Remote Procedure Call (RPC), and Remote Administration Protocol support.
.

<System.Flags()> _

.

    [System.Flags()]

.

using System;

.

using System.IO;

.

using System.Windows.Forms;

.

using System.Runtime.InteropServices;

.

            if ( pintError > 0 ) { throw new System.ComponentModel.Win32Exception ( pintError ); }

.

using System;

.

using System.Runtime.InteropServices;

.

    using System.DirectoryServices.ActiveDirectory;

.
Summary
Adds a scheduled task to a system.
.

using System;

.

using System.Collections.Generic;

.

using System.Runtime.InteropServices;

.

using System.Security;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

                throw new System.ComponentModel.Win32Exception(ret);

.

                throw new System.ComponentModel.Win32Exception(ret);

.

namespace System.Runtime.InteropServices

.

using System;

.

using System.Runtime.InteropServices;

.

using System.Collections ;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)]

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_version_major;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_version_minor;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.U4)] public UInt32 sv101_type;

.

            [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)] public string sv101_comment;

.

                        //Cast the pointer to a ulong so this addition will work on 32-bit or 64-bit systems.

.

The System.Data.Sql.SqlDataSourceEnumerator class is an alternative to this API, for enumerating SQL Servers on a network.

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

       level = int.Parse(System.Text.RegularExpressions.Regex.Replace(typeof(T).Name, @"[^\d]", ""));

.

      throw new System.ComponentModel.Win32Exception(ret);

.

    ''' This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA.

.

        ' Clean up buffer allocated by system

.

     If System.String.Compare(shi2.shi2_path, "c:\deletemeplease" True) = 0 Then

.

private void button1_Click(object sender, System.EventArgs e)

.

            //Remember, 64-bit systems have 64-bit pointers. Using ToInt32 will cause an ArithmeticOverview exception.

.

Imports System

.

Imports System.Runtime.InteropServices

.

Imports System.text

.

        ' Clean up buffer allocated by system

.

  Imports System

.

  Imports System.Runtime.InteropServices

.

    using System;

.

    using System.Collections;

.

    using System.IO;

.

    using System.Runtime.InteropServices;

.

    using System.Text;

.

    Imports System.Management

.

  System.Console.WriteLine(aRebootTime);

.

using BOOL = System.Boolean;

.

using DWORD = System.UInt32;

.

using LPWSTR = System.String;

.

using NET_API_STATUS = System.UInt32;

.

using System.Runtime.InteropServices;

.

using BOOL = System.Boolean;

.

using DWORD = System.UInt32;

.

using LPWSTR = System.String;

.

using NET_API_STATUS = System.UInt32;

.

                // previous line has been causing "arithmetic operation resulted in an overflow" exception on x86 systems for me. Fixed with the .Add method.

.

        Return New System.ComponentModel.Win32Exception(RetVal).Message

.

    // Passing -1 as prefmaxlen makes the system allocate the buffer.

.

using System.DirectoryServices; //System.DirectoryServices

.

                    //throw new System.ApplicationException("Could not get user's Full Name.");

.

Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices.UnmanagedType

.

Imports System.Runtime.InteropServices.Marshal

.

Imports System.Runtime.InteropServices.StructLayoutAttribute

.

I added the Sample code for x64 systems because when I ran it, I kept getting an arithmetic overflow error. I tried forcing PowerShell to compile it for x86, but then I would get an invalid image error. Converting all the "int" to "Int64" seems to do the trick.

.

        using System;

.

        using System.Runtime.InteropServices;

.

        using System.Collections;

.

        using System.Net.Sockets;

.

Sample PowerShell Code for x64 systems

.

        using System;

.

        using System.Runtime.InteropServices;

.

        using System.Collections;

.

using System;

.

using System.Runtime.InteropServices;

.

using System;

.

using System.Runtime.InteropServices;

.

using System;

.

using System.Runtime.InteropServices;

.

Shared Function NetWkstaUserEnum(ByVal servername As String, ByVal level As Integer, <System.Runtime.InteropServices.Out()> ByRef bufptr As IntPtr, ByVal prefmaxlen As Integer, <System.Runtime.InteropServices.Out()> ByRef entriesread As Integer, <System.Runtime.InteropServices.Out()> ByRef totalentries As Integer, ByRef resume_handle As Integer) As Integer

.

WMI can do this sort of thing (the System.Management namespace in .Net 2.0)

.

If you want to find the user logged in to the workstation, consider instead a WMI query ("select UserName from Win32_ComputerSystem"), which has certain advantages (runs faster, less ambigious results, doesn't require Interop if using .Net 2.0 System.Management namespace, etc.)

.

            Console.WriteLine("A system error has occurred : " + nStatus);

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]

.

        System.Windows.Forms.MessageBox.Show(domain);

glossary

.

Distributed computing is a programming model in which processing occurs in many different places (or nodes) around a network. Processing can occur wherever it makes the most sense, whether that is on a server, personal computer, handheld device, or other smart device. In contrast to the two-node system prevalent today (the client and the centralized server), Microsoft .NET uses distributed computing.

.
Summary
LibHolocaust, System.AIPCC.Pinvoke (new to LH ver 1.0.3.9b, replaces System.AIPCC.WindowsAPI in older versions)
.

    Namespaces: System.AIPCC.Pinvoke.Functions (seperated further by libname, wont list it here though)

.

           System.AIPCC.Pinvoke.Structures

.

           System.AIPCC.Pinvoke.Enums

.

           System.AIPCC.Pinvoke.Constants

.

           System.AIPCC.Pinvoke.Callbacks (delegates)

.

     Namespaces: System.AIPCC.Pinvoke.COM.UUID

.

             System.AIPCC.Pinvoke.COM.Interfaces

.

             System.AIPCC.Pinvoke.COM.Classes

.

             System.AIPCC.Pinvoke.COM       <- contains base functions such as CoInitialize()

gsapi

.

    private static extern void gsapi_delete_instance(System.IntPtr pinstance);

.

    Private Shared Sub gsapi_delete_instance(ByVal pinstance As System.IntPtr)

.

   System.IntPtr pinstance;  /* Class instance variable */

.

    if (pinstance != System.IntPtr.Zero)

.

       pinstance = System.IntPtr.Zero;

.

   System.IntPtr pinstance;  /* Class instance variable */

.

        if (pinstance != System.IntPtr.Zero)

.

        pinstance = System.IntPtr.Zero;

.

   private static extern int gsapi_new_instance(ref System.IntPtr pinstance, System.IntPtr handle);

.

   Private Shared Function gsapi_new_instance(ByRef pinstance As System.IntPtr, ByVal handle As System.IntPtr) As Integer

.

   System.IntPtr pinstance= IntPtr.Zero;

.

using System;

.

using System.Runtime.InteropServices;

.

    private static extern int gsapi_new_instance(ref System.IntPtr pinstance, System.IntPtr handle);

.

    private static extern void gsapi_delete_instance(System.IntPtr pinstance);

kernel32

.

    rgchFullModulePath = System.Reflection.Assembly.GetExecutingAssembly().Location;

.

[System.String.Intern] is the closest thing, although an atom is different from a string.

.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.
Summary
Is used to get OSVERSIONINFOEX, you can try the System.Environment.OSVersion class.
.

    Dim si As New SYSTEM_INFO

.

        GetSystemInfo(si)

.

System.Environment.OSVersion is provided in all .Net versions and has the same information.

.

OperatingSystem Class from System namespace has similar properties and methods

.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.

   [In] ref System.Threading.NativeOverlapped lpOverlapped);

.

using System;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

        public COLORREF(System.Drawing.Color color)

.

        public System.Drawing.Color GetColor()

.

        return System.Drawing.Color.FromArgb((int)(0x000000FFU & ColorDWORD),

.

        public void SetColor(System.Drawing.Color color)

.

using System.Runtime.InteropServices; // Needed for the DllImport Attribute

.

        throw new System.ComponentModel.Win32Exception(err);

.

using System;

.

using System.Runtime.InteropServices;

.

I think that in .NET 2.0 the System.Threading.EventWaitHandle class does the same that the example.

.

        Win32API.SYSTEM_INFO sysinfo = new Win32API.SYSTEM_INFO();

.

        Win32API.GetSystemInfo(ref sysinfo);

.

    internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)

.

    internal static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);

.

    internal struct SYSTEM_INFO

.

        Win32API.SYSTEM_INFO sysinfo = new Win32API.SYSTEM_INFO();

.

        Win32API.GetSystemInfo(ref sysinfo);

.

    internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)

.

    internal static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);

.

    internal struct SYSTEM_INFO

.

  using System.Runtime.InteropServices;

.

  using System;

.

    public class frmMain : System.Windows.Forms.Form

.
See
System.Threading.Mutex in .NET Framework 1.1
.

        ACCESS_SYSTEM_SECURITY = 0x01000000L

.

using System;

.

using System.IO;

.

using System.Runtime.InteropServices;

.

using System.ComponentModel;

.

using System.Text;

.

    /// and a System.IO.Stream subclass.  Basically, it simplifies the unnecessarily horrific process

.

            System.Threading.Thread.Sleep(dataRead ? 50 : 1000);

.

            System.Threading.Thread.Sleep(1000);

.

[System.Diagnostics.Process.Start]

.
Summary
Creates a symbolic link in the filesystem. Requires Vista or higher. Requires administrator access.
.

[return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.I1)]

.

   SecurityAttributes, uint StackSize, System.Threading.ThreadStart StartFunction,

.

Try System.Threading.Thread.Start. It doesn't give you all the control of directly calling CreateThread, (such as specifing the flags), but it will get you a vanilla thread to spin up.

.

    /// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.

.

    /// The callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.

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


 
Access PInvoke.net directly from VS: