elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Librería de Snippets para VB.NET !! (Compartan aquí sus snippets)
0 Usuarios y 4 Visitantes están viendo este tema.
Páginas: 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 [48] 49 50 51 52 53 54 55 56 57 58 59 Ir Abajo Respuesta Imprimir
Autor Tema: Librería de Snippets para VB.NET !! (Compartan aquí sus snippets)  (Leído 486,014 veces)
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #470 en: 20 Junio 2015, 19:50 pm »

UserAccountUtil.vb, una class para realizar tareas comunes relacioandas con las cuentas de usuario (LOCALES) de Windows.

Diagrama de Class:


Código fuente:
Código
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 20-June-2015
  4. ' ***********************************************************************
  5. ' <copyright file="UserAccountUtil.vb" company="Elektro Studios">
  6. '     Copyright (c) Elektro Studios. All rights reserved.
  7. ' </copyright>
  8. ' ***********************************************************************
  9.  
  10. #Region " Public Members Summary "
  11.  
  12. #Region " Properties "
  13.  
  14. ' UserAccountUtil.CurrentUser As UserPrincipal
  15. ' UserAccountUtil.CurrentUserIsAdmin As Boolean
  16.  
  17. #End Region
  18.  
  19. #Region " Functions "
  20.  
  21. ' UserAccountUtil.Create(String, String, String, String, Boolean, Boolean) As UserPrincipal
  22. ' UserAccountUtil.FindProfilePath(SecurityIdentifier) As String
  23. ' UserAccountUtil.FindProfilePath(String) As String
  24. ' UserAccountUtil.FindSid(String) As SecurityIdentifier
  25. ' UserAccountUtil.FindUser(SecurityIdentifier) As UserPrincipal
  26. ' UserAccountUtil.FindUser(String) As UserPrincipal
  27. ' UserAccountUtil.FindUsername(SecurityIdentifier) As String
  28. ' UserAccountUtil.GetAllUsers() As List(Of UserPrincipal)
  29. ' UserAccountUtil.IsAdmin(String) As Boolean
  30. ' UserAccountUtil.IsMemberOfGroup(String, String) As Boolean
  31. ' UserAccountUtil.IsMemberOfGroup(String, WellKnownSidType) As Boolean
  32.  
  33. #End Region
  34.  
  35. #Region " Methods "
  36.  
  37. ' UserAccountUtil.Add(String, String, String, String, Boolean, Boolean, WellKnownSidType)
  38. ' UserAccountUtil.Add(UserPrincipal, WellKnownSidType)
  39. ' UserAccountUtil.Delete(String)
  40.  
  41. #End Region
  42.  
  43. #End Region
  44.  
  45. #Region " Option Statements "
  46.  
  47. Option Strict On
  48. Option Explicit On
  49. Option Infer Off
  50.  
  51. #End Region
  52.  
  53. #Region " Imports "
  54.  
  55. Imports System
  56. Imports System.Collections.Generic
  57. Imports System.DirectoryServices.AccountManagement
  58. Imports System.Linq
  59. Imports System.Security.Principal
  60.  
  61. #End Region
  62.  
  63. ''' <summary>
  64. ''' Contains related Windows user-account utilities.
  65. ''' </summary>
  66. Public NotInheritable Class UserAccountUtil
  67.  
  68. #Region " Properties "
  69.  
  70.    ''' ----------------------------------------------------------------------------------------------------
  71.    ''' <summary>
  72.    ''' Gets an <see cref="UserPrincipal"/> object that represents the current user.
  73.    ''' </summary>
  74.    ''' ----------------------------------------------------------------------------------------------------
  75.    ''' <value>
  76.    ''' An <see cref="UserPrincipal"/> object that represents the current user.
  77.    ''' </value>
  78.    ''' ----------------------------------------------------------------------------------------------------
  79.    Public Shared ReadOnly Property CurrentUser As UserPrincipal
  80.        Get
  81.            If UserAccountUtil.currentUserB Is Nothing Then
  82.                UserAccountUtil.currentUserB = UserAccountUtil.FindUser(Environment.UserName)
  83.            End If
  84.            Return UserAccountUtil.currentUserB
  85.        End Get
  86.    End Property
  87.    ''' <summary>
  88.    ''' (Backing Field)
  89.    ''' Gets an <see cref="UserPrincipal"/> object that represents the current user.
  90.    ''' </summary>
  91.    Private Shared currentUserB As UserPrincipal
  92.  
  93.    ''' ----------------------------------------------------------------------------------------------------
  94.    ''' <summary>
  95.    ''' Gets a value that indicates whether the current user has Administrator privileges.
  96.    ''' </summary>
  97.    ''' ----------------------------------------------------------------------------------------------------
  98.    ''' <value>
  99.    ''' A value that indicates whether the current user has Administrator privileges.
  100.    ''' </value>
  101.    ''' ----------------------------------------------------------------------------------------------------
  102.    Public Shared ReadOnly Property CurrentUserIsAdmin As Boolean
  103.        Get
  104.            Using group As GroupPrincipal =
  105.                GroupPrincipal.FindByIdentity(CurrentUser.Context,
  106.                                              IdentityType.Sid,
  107.                                              New SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, Nothing).Value)
  108.  
  109.                Return UserAccountUtil.CurrentUser.IsMemberOf(group)
  110.            End Using
  111.        End Get
  112.    End Property
  113.  
  114. #End Region
  115.  
  116. #Region " Constructors "
  117.  
  118.    ''' <summary>
  119.    ''' Prevents a default instance of the <see cref="UserAccountUtil"/> class from being created.
  120.    ''' </summary>
  121.    Private Sub New()
  122.    End Sub
  123.  
  124. #End Region
  125.  
  126. #Region " Public Methods "
  127.  
  128.    ''' ----------------------------------------------------------------------------------------------------
  129.    ''' <remarks>
  130.    ''' Title : Get all user-accounts.
  131.    ''' Author: Elektro
  132.    ''' Date  : 20-June-2015
  133.    ''' </remarks>
  134.    ''' ----------------------------------------------------------------------------------------------------
  135.    ''' <example>
  136.    ''' Dim users As List(Of UserPrincipal) = UserAccountUtil.GetAllUsers()
  137.    ''' </example>
  138.    ''' ----------------------------------------------------------------------------------------------------
  139.    ''' <summary>
  140.    ''' Find and returns all the user accounts of the current machine context.
  141.    ''' </summary>
  142.    ''' ----------------------------------------------------------------------------------------------------
  143.    ''' <returns>
  144.    ''' A <see cref="List(Of UserPrincipal)"/> collection that contains the users.
  145.    ''' </returns>
  146.    ''' ----------------------------------------------------------------------------------------------------
  147.    <DebuggerStepThrough>
  148.    Public Shared Function GetAllUsers() As List(Of UserPrincipal)
  149.  
  150.        Dim context As New PrincipalContext(ContextType.Machine)
  151.  
  152.        Using user As New UserPrincipal(context)
  153.  
  154.            Using searcher As New PrincipalSearcher(user)
  155.  
  156.                Return searcher.FindAll.Cast(Of UserPrincipal).ToList
  157.  
  158.            End Using ' searcher
  159.  
  160.        End Using ' user
  161.  
  162.    End Function
  163.  
  164.    ''' ----------------------------------------------------------------------------------------------------
  165.    ''' <remarks>
  166.    ''' Title : Find user-account by name.
  167.    ''' Author: Elektro
  168.    ''' Date  : 19-June-2015
  169.    ''' </remarks>
  170.    ''' ----------------------------------------------------------------------------------------------------
  171.    ''' <example>
  172.    ''' Dim user As UserPrincipal = UserAccountUtil.FindUser(username:="Administrator")
  173.    ''' </example>
  174.    ''' ----------------------------------------------------------------------------------------------------
  175.    ''' <summary>
  176.    ''' Finds an user account that matches the specified name in the current machine context.
  177.    ''' </summary>
  178.    ''' ----------------------------------------------------------------------------------------------------
  179.    ''' <param name="username">
  180.    ''' The user name to find.
  181.    ''' </param>
  182.    ''' ----------------------------------------------------------------------------------------------------
  183.    ''' <returns>
  184.    ''' An <see cref="UserPrincipal"/> object that contains the user data.
  185.    ''' </returns>
  186.    ''' ----------------------------------------------------------------------------------------------------
  187.    ''' <exception cref="ArgumentException">
  188.    ''' User not found.;username
  189.    ''' </exception>
  190.    ''' ----------------------------------------------------------------------------------------------------
  191.    <DebuggerStepThrough>
  192.    Public Shared Function FindUser(ByVal username As String) As UserPrincipal
  193.  
  194.        Dim context As New PrincipalContext(ContextType.Machine)
  195.  
  196.        Using user As New UserPrincipal(context)
  197.  
  198.            Using searcher As New PrincipalSearcher(user)
  199.  
  200.                Try
  201.                    Return (From p As Principal In searcher.FindAll
  202.                            Where p.Name.Equals(username, StringComparison.OrdinalIgnoreCase)).
  203.                            Cast(Of UserPrincipal).
  204.                            First
  205.  
  206.                Catch ex As InvalidOperationException
  207.                    Throw New ArgumentException(message:="User not found.", paramName:="username", innerException:=ex)
  208.  
  209.                End Try
  210.  
  211.            End Using ' searcher
  212.  
  213.        End Using ' user
  214.  
  215.    End Function
  216.  
  217.    ''' ----------------------------------------------------------------------------------------------------
  218.    ''' <remarks>
  219.    ''' Title : Find user-account by SID.
  220.    ''' Author: Elektro
  221.    ''' Date  : 19-June-2015
  222.    ''' </remarks>
  223.    ''' ----------------------------------------------------------------------------------------------------
  224.    ''' <example>
  225.    ''' Dim user As UserPrincipal = UserAccountUtil.FindUser(sid:=New SecurityIdentifier("S-1-5-21-1780771175-1208154119-2269826705-500"))
  226.    ''' </example>
  227.    ''' ----------------------------------------------------------------------------------------------------
  228.    ''' <summary>
  229.    ''' Finds an user account that matches the specified security identifier (SID) in the current machine context.
  230.    ''' </summary>
  231.    ''' ----------------------------------------------------------------------------------------------------
  232.    ''' <param name="sid">
  233.    ''' A <see cref="SecurityIdentifier"/> (SID) object.
  234.    ''' </param>
  235.    ''' ----------------------------------------------------------------------------------------------------
  236.    ''' <returns>
  237.    ''' An <see cref="UserPrincipal"/> object that contains the user data.
  238.    ''' </returns>
  239.    ''' ----------------------------------------------------------------------------------------------------
  240.    <DebuggerStepThrough>
  241.    Public Shared Function FindUser(ByVal sid As SecurityIdentifier) As UserPrincipal
  242.  
  243.        Dim context As New PrincipalContext(ContextType.Machine)
  244.  
  245.        Using user As New UserPrincipal(context)
  246.  
  247.            Using searcher As New PrincipalSearcher(user)
  248.  
  249.                Try
  250.                    Return (From p As Principal In searcher.FindAll
  251.                            Where p.Sid.Value.Equals(sid.Value, StringComparison.OrdinalIgnoreCase)).
  252.                            Cast(Of UserPrincipal).
  253.                            First
  254.  
  255.                Catch ex As InvalidOperationException
  256.                    Throw New ArgumentException(message:="User not found.", paramName:="username", innerException:=ex)
  257.  
  258.                End Try
  259.  
  260.            End Using ' searcher
  261.  
  262.        End Using ' user
  263.  
  264.    End Function
  265.  
  266.    ''' ----------------------------------------------------------------------------------------------------
  267.    ''' <remarks>
  268.    ''' Title : Find user-account name by SID.
  269.    ''' Author: Elektro
  270.    ''' Date  : 19-June-2015
  271.    ''' </remarks>
  272.    ''' ----------------------------------------------------------------------------------------------------
  273.    ''' <example>
  274.    ''' Dim username As String = UserAccountUtil.FindUsername(sid:=New SecurityIdentifier("S-1-5-21-1780771175-1208154119-2269826705-500"))
  275.    ''' </example>
  276.    ''' ----------------------------------------------------------------------------------------------------
  277.    ''' <summary>
  278.    ''' Finds the username of the specified security identifier (SID) in the current machine context.
  279.    ''' </summary>
  280.    ''' ----------------------------------------------------------------------------------------------------
  281.    ''' <param name="sid">
  282.    ''' A <see cref="SecurityIdentifier"/> (SID) object.
  283.    ''' </param>
  284.    ''' ----------------------------------------------------------------------------------------------------
  285.    ''' <returns>
  286.    ''' The username.
  287.    ''' </returns>
  288.    ''' ----------------------------------------------------------------------------------------------------
  289.    <DebuggerStepThrough>
  290.    Public Shared Function FindUsername(ByVal sid As SecurityIdentifier) As String
  291.  
  292.        Using user As UserPrincipal = UserAccountUtil.FindUser(sid)
  293.  
  294.            Return user.Name
  295.  
  296.        End Using
  297.  
  298.    End Function
  299.  
  300.    ''' ----------------------------------------------------------------------------------------------------
  301.    ''' <remarks>
  302.    ''' Title : Find user-account SID by username.
  303.    ''' Author: Elektro
  304.    ''' Date  : 19-June-2015
  305.    ''' </remarks>
  306.    ''' ----------------------------------------------------------------------------------------------------
  307.    ''' <example>
  308.    ''' Dim sid As SecurityIdentifier = UserAccountUtil.FindSid(username:="Administrator"))
  309.    ''' </example>
  310.    ''' ----------------------------------------------------------------------------------------------------
  311.    ''' <summary>
  312.    ''' Finds the security identifier (SID) of the specified username account in the current machine context.
  313.    ''' </summary>
  314.    ''' ----------------------------------------------------------------------------------------------------
  315.    ''' <param name="username">
  316.    ''' The user name.
  317.    ''' </param>
  318.    ''' ----------------------------------------------------------------------------------------------------
  319.    ''' <returns>
  320.    ''' A <see cref="SecurityIdentifier"/> (SID) object.
  321.    ''' </returns>
  322.    ''' ----------------------------------------------------------------------------------------------------
  323.    <DebuggerStepThrough>
  324.    Public Shared Function FindSid(ByVal username As String) As SecurityIdentifier
  325.  
  326.        Return UserAccountUtil.FindUser(username).Sid
  327.  
  328.    End Function
  329.  
  330.    ''' ----------------------------------------------------------------------------------------------------
  331.    ''' <remarks>
  332.    ''' Title : Find user-account's profile path by username.
  333.    ''' Author: Elektro
  334.    ''' Date  : 19-June-2015
  335.    ''' </remarks>
  336.    ''' ----------------------------------------------------------------------------------------------------
  337.    ''' <example>
  338.    ''' Dim profilePath As String = UserAccountUtil.FindProfilePath(username:="Administrator"))
  339.    ''' </example>
  340.    ''' ----------------------------------------------------------------------------------------------------
  341.    ''' <summary>
  342.    ''' Finds the profile directory path of the specified username account in the current machine context.
  343.    ''' </summary>
  344.    ''' ----------------------------------------------------------------------------------------------------
  345.    ''' <param name="username">
  346.    ''' The user name to find.
  347.    ''' </param>
  348.    ''' ----------------------------------------------------------------------------------------------------
  349.    ''' <returns>
  350.    ''' The profile directory path.
  351.    ''' </returns>
  352.    ''' ----------------------------------------------------------------------------------------------------
  353.    <DebuggerStepThrough>
  354.    Public Shared Function FindProfilePath(ByVal userName As String) As String
  355.  
  356.        Using user As UserPrincipal = UserAccountUtil.FindUser(userName)
  357.  
  358.            Return CStr(My.Computer.Registry.GetValue(String.Format("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\{0}",
  359.                                                                    user.Sid.Value),
  360.                                                                    "ProfileImagePath", ""))
  361.  
  362.        End Using
  363.  
  364.    End Function
  365.  
  366.    ''' ----------------------------------------------------------------------------------------------------
  367.    ''' <remarks>
  368.    ''' Title : Find user-account's profile path by SID.
  369.    ''' Author: Elektro
  370.    ''' Date  : 19-June-2015
  371.    ''' </remarks>
  372.    ''' ----------------------------------------------------------------------------------------------------
  373.    ''' <example>
  374.    ''' Dim profilePath As String = UserAccountUtil.FindProfilePath(sid:=New SecurityIdentifier("S-1-5-21-1780771175-1208154119-2269826705-500"))
  375.    ''' </example>
  376.    ''' ----------------------------------------------------------------------------------------------------
  377.    ''' <summary>
  378.    ''' Finds the profile directory path of the specified username account in the current machine context.
  379.    ''' </summary>
  380.    ''' ----------------------------------------------------------------------------------------------------
  381.    ''' <param name="sid">
  382.    ''' A <see cref="SecurityIdentifier"/> (SID) object.
  383.    ''' </param>
  384.    ''' ----------------------------------------------------------------------------------------------------
  385.    ''' <returns>
  386.    ''' The profile directory path.
  387.    ''' </returns>
  388.    ''' ----------------------------------------------------------------------------------------------------
  389.    <DebuggerStepThrough>
  390.    Public Shared Function FindProfilePath(ByVal sid As SecurityIdentifier) As String
  391.  
  392.        Using user As UserPrincipal = UserAccountUtil.FindUser(sid)
  393.  
  394.            Return CStr(My.Computer.Registry.GetValue(String.Format("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\{0}",
  395.                                                                    user.Sid.Value),
  396.                                                                    "ProfileImagePath", ""))
  397.  
  398.        End Using
  399.  
  400.    End Function
  401.  
  402.    ''' ----------------------------------------------------------------------------------------------------
  403.    ''' <remarks>
  404.    ''' Title : User is Admin?.
  405.    ''' Author: Elektro
  406.    ''' Date  : 19-June-2015
  407.    ''' </remarks>
  408.    ''' ----------------------------------------------------------------------------------------------------
  409.    ''' <example>
  410.    ''' Dim userIsAdmin As Boolean = UserAccountUtil.IsAdmin(username:="Administrator")
  411.    ''' </example>
  412.    ''' ----------------------------------------------------------------------------------------------------
  413.    ''' <summary>
  414.    ''' Determines whether an user-account of the current machine context is an Administrator.
  415.    ''' </summary>
  416.    ''' ----------------------------------------------------------------------------------------------------
  417.    ''' <param name="username">
  418.    ''' The user name.
  419.    ''' </param>
  420.    ''' ----------------------------------------------------------------------------------------------------
  421.    ''' <returns>
  422.    ''' <c>True</c> if the user is an Administrator, otherwise, <c>False</c>.
  423.    ''' </returns>
  424.    ''' ----------------------------------------------------------------------------------------------------
  425.    <DebuggerStepThrough>
  426.    Public Shared Function IsAdmin(ByVal username As String) As Boolean
  427.  
  428.        Using user As UserPrincipal = UserAccountUtil.FindUser(username)
  429.  
  430.            Using group As GroupPrincipal = GroupPrincipal.FindByIdentity(user.Context, IdentityType.Sid, New SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, Nothing).Value)
  431.  
  432.                Return user.IsMemberOf(group)
  433.  
  434.            End Using ' group
  435.  
  436.        End Using ' user
  437.  
  438.    End Function
  439.  
  440.    ''' ----------------------------------------------------------------------------------------------------
  441.    ''' <remarks>
  442.    ''' Title : User is member of group...?.
  443.    ''' Author: Elektro
  444.    ''' Date  : 19-June-2015
  445.    ''' </remarks>
  446.    ''' ----------------------------------------------------------------------------------------------------
  447.    ''' <example>
  448.    ''' Dim userIsGuest As Boolean = UserAccountUtil.IsMemberOfGroup(username:="Administrator", groupSid:=WellKnownSidType.BuiltinGuestsSid)
  449.    ''' </example>
  450.    ''' ----------------------------------------------------------------------------------------------------
  451.    ''' <summary>
  452.    ''' Determines whether an user-account of the current machine context is a member of the specified group.
  453.    ''' </summary>
  454.    ''' ----------------------------------------------------------------------------------------------------
  455.    ''' <param name="username">
  456.    ''' The user name.
  457.    ''' </param>
  458.    '''
  459.    ''' <param name="groupSid">
  460.    ''' A <see cref="WellKnownSidType"/> security identifier (SID) that determines the account group.
  461.    ''' </param>
  462.    ''' ----------------------------------------------------------------------------------------------------
  463.    ''' <returns>
  464.    ''' <c>True</c> if the user is a member of the specified group, otherwise, <c>False</c>.
  465.    ''' </returns>
  466.    ''' ----------------------------------------------------------------------------------------------------
  467.    <DebuggerStepThrough>
  468.    Public Shared Function IsMemberOfGroup(ByVal username As String,
  469.                                           ByVal groupSid As WellKnownSidType) As Boolean
  470.  
  471.        Using user As UserPrincipal = UserAccountUtil.FindUser(username)
  472.  
  473.            Using group As GroupPrincipal = GroupPrincipal.FindByIdentity(user.Context, IdentityType.Sid, New SecurityIdentifier(groupSid, Nothing).Value)
  474.  
  475.                Return user.IsMemberOf(group)
  476.  
  477.            End Using ' group
  478.  
  479.        End Using ' user
  480.  
  481.    End Function
  482.  
  483.    ''' ----------------------------------------------------------------------------------------------------
  484.    ''' <remarks>
  485.    ''' Title : User is member of group...?.
  486.    ''' Author: Elektro
  487.    ''' Date  : 19-June-2015
  488.    ''' </remarks>
  489.    ''' ----------------------------------------------------------------------------------------------------
  490.    ''' <example>
  491.    ''' Dim userIsGuest As Boolean = UserAccountUtil.IsMemberOfGroup(username:="Administrator", groupname:="Guests")
  492.    ''' </example>
  493.    ''' ----------------------------------------------------------------------------------------------------
  494.    ''' <summary>
  495.    ''' Determines whether an user-account of the current machine context is a member of the specified group.
  496.    ''' </summary>
  497.    ''' ----------------------------------------------------------------------------------------------------
  498.    ''' <param name="username">
  499.    ''' The user name.
  500.    ''' </param>
  501.    '''
  502.    ''' <param name="groupname">
  503.    ''' The name of thehe group.
  504.    ''' </param>
  505.    ''' ----------------------------------------------------------------------------------------------------
  506.    ''' <returns>
  507.    ''' <c>True</c> if the user is a member of the specified group, otherwise, <c>False</c>.
  508.    ''' </returns>
  509.    ''' ----------------------------------------------------------------------------------------------------
  510.    <DebuggerStepThrough>
  511.    Public Shared Function IsMemberOfGroup(ByVal username As String,
  512.                                           ByVal groupname As String) As Boolean
  513.  
  514.        Using user As UserPrincipal = UserAccountUtil.FindUser(username)
  515.  
  516.            Using group As GroupPrincipal = GroupPrincipal.FindByIdentity(user.Context, IdentityType.Name, groupname)
  517.  
  518.                Return user.IsMemberOf(group)
  519.  
  520.            End Using ' group
  521.  
  522.        End Using ' user
  523.  
  524.    End Function
  525.  
  526.    ''' ----------------------------------------------------------------------------------------------------
  527.    ''' <remarks>
  528.    ''' Title : Create user-account.
  529.    ''' Author: Elektro
  530.    ''' Date  : 19-June-2015
  531.    ''' </remarks>
  532.    ''' ----------------------------------------------------------------------------------------------------
  533.    ''' <example>
  534.    ''' Dim user as UserPrincipal = UserAccountUtil.Create(username:="Elektro",
  535.    '''                                                    password:="",
  536.    '''                                                    displayName:="Elektro Account.",
  537.    '''                                                    description:="This is a test user-account.",
  538.    '''                                                    canChangePwd:=True,
  539.    '''                                                    pwdExpires:=False,
  540.    '''                                                    groupSid:=WellKnownSidType.BuiltinAdministratorsSid)
  541.    ''' </example>
  542.    ''' ----------------------------------------------------------------------------------------------------
  543.    ''' <summary>
  544.    ''' Creates a new user account in the current machine context.
  545.    ''' This function does NOT adds a new user in the current machine.
  546.    ''' </summary>
  547.    ''' ----------------------------------------------------------------------------------------------------
  548.    ''' <param name="username">
  549.    ''' The user name.
  550.    ''' </param>
  551.    '''
  552.    ''' <param name="password">
  553.    ''' The user password.
  554.    ''' If this value is empty, account is set to don't require any password.
  555.    ''' </param>
  556.    '''
  557.    ''' <param name="displayName">
  558.    ''' The display name of the user account.
  559.    ''' </param>
  560.    '''
  561.    ''' <param name="description">
  562.    ''' The description of the user account.
  563.    ''' </param>
  564.    '''
  565.    ''' <param name="canChangePwd">
  566.    ''' A value that indicates whether the user can change its password.
  567.    ''' </param>
  568.    '''
  569.    ''' <param name="pwdExpires">
  570.    ''' A value that indicates whether the password should expire.
  571.    ''' </param>
  572.    ''' ----------------------------------------------------------------------------------------------------
  573.    ''' <returns>
  574.    ''' An <see cref="UserPrincipal"/> object that contains the user data.
  575.    ''' </returns>
  576.    ''' ----------------------------------------------------------------------------------------------------
  577.    <DebuggerStepThrough>
  578.    Public Shared Function Create(ByVal username As String,
  579.                                  ByVal password As String,
  580.                                  ByVal displayName As String,
  581.                                  ByVal description As String,
  582.                                  ByVal canChangePwd As Boolean,
  583.                                  ByVal pwdExpires As Boolean) As UserPrincipal
  584.  
  585.        Using context As New PrincipalContext(ContextType.Machine)
  586.  
  587.            Dim user As New UserPrincipal(context)
  588.  
  589.            With user
  590.  
  591.                .Name = username
  592.  
  593.                .SetPassword(password)
  594.                .PasswordNotRequired = String.IsNullOrEmpty(password)
  595.  
  596.                .DisplayName = displayName
  597.                .Description = description
  598.  
  599.                .UserCannotChangePassword = canChangePwd
  600.                .PasswordNeverExpires = pwdExpires
  601.  
  602.                .Enabled = True
  603.                .Save()
  604.  
  605.            End With
  606.  
  607.            Return user
  608.  
  609.        End Using
  610.  
  611.    End Function
  612.  
  613.    ''' ----------------------------------------------------------------------------------------------------
  614.    ''' <remarks>
  615.    ''' Title : Add user-account.
  616.    ''' Author: Elektro
  617.    ''' Date  : 19-June-2015
  618.    ''' </remarks>
  619.    ''' ----------------------------------------------------------------------------------------------------
  620.    ''' <example>
  621.    ''' UserAccountUtil.Add(username:="Elektro",
  622.    '''                     password:="",
  623.    '''                     displayName:="Elektro Account.",
  624.    '''                     description:="This is a test user-account.",
  625.    '''                     canChangePwd:=True,
  626.    '''                     pwdExpires:=False,
  627.    '''                     groupSid:=WellKnownSidType.BuiltinAdministratorsSid)
  628.    ''' </example>
  629.    ''' ----------------------------------------------------------------------------------------------------
  630.    ''' <summary>
  631.    ''' Adds a new user account in the current machine context.
  632.    ''' </summary>
  633.    ''' ----------------------------------------------------------------------------------------------------
  634.    ''' <param name="username">
  635.    ''' The user name.
  636.    ''' </param>
  637.    '''
  638.    ''' <param name="password">
  639.    ''' The user password.
  640.    ''' If this value is empty, account is set to don't require any password.
  641.    ''' </param>
  642.    '''
  643.    ''' <param name="displayName">
  644.    ''' The display name of the user account.
  645.    ''' </param>
  646.    '''
  647.    ''' <param name="description">
  648.    ''' The description of the user account.
  649.    ''' </param>
  650.    '''
  651.    ''' <param name="canChangePwd">
  652.    ''' A value that indicates whether the user can change its password.
  653.    ''' </param>
  654.    '''
  655.    ''' <param name="pwdExpires">
  656.    ''' A value that indicates whether the password should expire.
  657.    ''' </param>
  658.    '''
  659.    ''' <param name="groupSid">
  660.    ''' A <see cref="WellKnownSidType"/> security identifier (SID) that determines the account group where to add the user.
  661.    ''' </param>
  662.    ''' ----------------------------------------------------------------------------------------------------
  663.    <DebuggerStepThrough>
  664.    Public Shared Sub Add(ByVal username As String,
  665.                          ByVal password As String,
  666.                          ByVal displayName As String,
  667.                          ByVal description As String,
  668.                          ByVal canChangePwd As Boolean,
  669.                          ByVal pwdExpires As Boolean,
  670.                          Optional ByVal groupSid As WellKnownSidType = WellKnownSidType.BuiltinUsersSid)
  671.  
  672.        Using context As New PrincipalContext(ContextType.Machine)
  673.  
  674.            Using user As UserPrincipal = UserAccountUtil.Create(username, password, displayName, description, canChangePwd, pwdExpires)
  675.  
  676.                Using group As GroupPrincipal = GroupPrincipal.FindByIdentity(context, IdentityType.Sid, New SecurityIdentifier(groupSid, Nothing).Value)
  677.  
  678.                    group.Members.Add(user)
  679.                    group.Save()
  680.  
  681.                End Using ' group
  682.  
  683.            End Using ' user
  684.  
  685.        End Using ' context
  686.  
  687.    End Sub
  688.  
  689.    ''' ----------------------------------------------------------------------------------------------------
  690.    ''' <remarks>
  691.    ''' Title : Add user-account.
  692.    ''' Author: Elektro
  693.    ''' Date  : 19-June-2015
  694.    ''' </remarks>
  695.    ''' ----------------------------------------------------------------------------------------------------
  696.    ''' <example>
  697.    ''' UserAccountUtil.Add(user:=myUserPrincipal, groupSid:=WellKnownSidType.BuiltinAdministratorsSid)
  698.    ''' </example>
  699.    ''' ----------------------------------------------------------------------------------------------------
  700.    ''' <summary>
  701.    ''' Adds a new user account in the current machine context.
  702.    ''' </summary>
  703.    ''' ----------------------------------------------------------------------------------------------------
  704.    ''' <param name="user">
  705.    ''' An <see cref="UserPrincipal"/> object that contains the user data.
  706.    ''' </param>
  707.    '''
  708.    ''' <param name="groupSid">
  709.    ''' A <see cref="WellKnownSidType"/> security identifier (SID) that determines the account group where to add the user.
  710.    ''' </param>
  711.    ''' ----------------------------------------------------------------------------------------------------
  712.    <DebuggerStepThrough>
  713.    Public Shared Sub Add(ByVal user As UserPrincipal,
  714.                          Optional ByVal groupSid As WellKnownSidType = WellKnownSidType.BuiltinUsersSid)
  715.  
  716.        Using context As New PrincipalContext(ContextType.Machine)
  717.  
  718.            Using group As GroupPrincipal = GroupPrincipal.FindByIdentity(context, IdentityType.Sid, New SecurityIdentifier(groupSid, Nothing).Value)
  719.  
  720.                group.Members.Add(user)
  721.                group.Save()
  722.  
  723.            End Using ' group
  724.  
  725.        End Using ' context
  726.  
  727.    End Sub
  728.  
  729.    ''' ----------------------------------------------------------------------------------------------------
  730.    ''' <remarks>
  731.    ''' Title : Delete user-account.
  732.    ''' Author: Elektro
  733.    ''' Date  : 19-June-2015
  734.    ''' </remarks>
  735.    ''' ----------------------------------------------------------------------------------------------------
  736.    ''' <example>
  737.    ''' UserAccountUtil.Delete(username:="User name")
  738.    ''' </example>
  739.    ''' ----------------------------------------------------------------------------------------------------
  740.    ''' <summary>
  741.    ''' Deletes an user account in the current machine context.
  742.    ''' </summary>
  743.    ''' ----------------------------------------------------------------------------------------------------
  744.    ''' <param name="username">
  745.    ''' The user name of the user-account to delete.
  746.    ''' </param>
  747.    ''' ----------------------------------------------------------------------------------------------------
  748.    ''' <exception cref="ArgumentException">
  749.    ''' User not found.;username
  750.    ''' </exception>
  751.    ''' ----------------------------------------------------------------------------------------------------
  752.    <DebuggerStepThrough>
  753.    Public Shared Sub Delete(ByVal username As String)
  754.  
  755.        Using curUser As UserPrincipal = UserAccountUtil.FindUser(username)
  756.  
  757.            curUser.Delete()
  758.  
  759.        End Using
  760.  
  761.    End Sub
  762.  
  763. #End Region
  764.  
  765. End Class
  766.  


En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #471 en: 22 Junio 2015, 03:08 am »

Comparto esta class que sirve para registrar una extensión de archivo, o para obtener información de una extensión ya registrada en el sistema.

Si encuentran cualquier bug, hagan el favor de comunicármelo para arreglarlo en futuras versiones.



Diagrama de Class:




Ejemplos de uso:
Código
  1. FileAssocUtil.Register(regUser:=FileAssocUtil.RegistryUser.CurrentUser,
  2.                       extensionName:=".elek",
  3.                       keyReferenceName:="ElektroFile",
  4.                       friendlyName:="Elektro File",
  5.                       defaultIcon:="%WinDir%\System32\Shell32.ico",
  6.                       iconIndex:=0,
  7.                       executable:="%WinDir%\notepad.exe",
  8.                       arguments:="""%1""")

Código
  1. Dim isRegistered As Boolean = FileAssocUtil.IsRegistered(".elek")

Código
  1. Dim feInfo As FileAssocUtil.FileExtensionInfo = FileAssocUtil.GetFileExtensionInfo(".wav")
  2.  
  3. Dim sb As New StringBuilder
  4. With sb
  5.    .AppendLine(String.Format("FriendlyDocName: {0}", feInfo.FriendlyDocName))
  6.    .AppendLine(String.Format("ContentType: {0}", feInfo.ContentType))
  7.    .AppendLine(String.Format("DefaultIcon: {0}", feInfo.DefaultIcon))
  8.    .AppendLine("-----------------------------------------------------------")
  9.    .AppendLine(String.Format("FriendlyAppName: {0}", feInfo.FriendlyAppName))
  10.    .AppendLine(String.Format("Executable: {0}", feInfo.Executable))
  11.    .AppendLine(String.Format("Command: {0}", feInfo.Command))
  12.    .AppendLine("-----------------------------------------------------------")
  13.    .AppendLine(String.Format("DropTarget: {0}", feInfo.DropTarget))
  14.    .AppendLine(String.Format("InfoTip: {0}", feInfo.InfoTip))
  15.    .AppendLine(String.Format("No Open: {0}", feInfo.NoOpen))
  16.    .AppendLine(String.Format("Shell Extension: {0}", feInfo.ShellExtension))
  17.    .AppendLine(String.Format("Shell New Value: {0}", feInfo.ShellNewValue))
  18.    .AppendLine("-----------------------------------------------------------")
  19.    .AppendLine(String.Format("Supported URI Protocols: {0}", feInfo.SupportedUriProtocols))
  20.    .AppendLine(String.Format("DDE Application: {0}", feInfo.DdeApplication))
  21.    .AppendLine(String.Format("DDE Command: {0}", feInfo.DdeCommand))
  22.    .AppendLine(String.Format("DDE If Exec: {0}", feInfo.DdeIfExec))
  23.    .AppendLine(String.Format("DDE Topic: {0}", feInfo.DdeTopic))
  24. End With
  25.  
  26. MsgBox(sb.ToString)





Código fuente:
http://pastebin.com/gXbp78Pv
http://pastebin.com/aAscfAev


« Última modificación: 22 Junio 2015, 05:02 am por Eleкtro » En línea

tincopasan


Desconectado Desconectado

Mensajes: 1.286

No es lo mismo conocer el camino que recorrerlo.


Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #472 en: 22 Junio 2015, 10:11 am »

Elektro:
            no entro nunca a la sección net así que recién hoy veo el trabajo que llevas realizado(no todo porque es mucho para ver en una sola vez y no es que me encante la programación) así que FELICITACIONES!! y no lo tomes como un grito sino como lo que es, admiración. Vi un par de codes de decimales y hexadeciales pero no vi de binarios, claro que no tiene uso, salvo a quienes nos gusta la ingeniería inversa más que la programación en si, pero es un minúsculo granito de arena.
Para pasar enteros a binarios

Código
  1.  Public Function DecaBin(numero As Integer) As String
  2.        If numero <= 2 Then 'Caso Base
  3.            DecaBin = (numero \ 2) & (numero Mod 2)
  4.        Else 'Caso Recursivo
  5.            DecaBin = DecaBin(numero \ 2) & numero Mod 2
  6.        End If
  7.    End Function
  8.  
  9.  
  10. # ejemplo de uso
  11.  
  12. Textbox = DecaBin(numeromio)
En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #473 en: 22 Junio 2015, 13:12 pm »

@tincopasan

Antes de nada, Gracias por tu comentario ...ya hacia tiempo que nadie (más que yo) aportaba algo a este hilo, y que lo aporte alguien que no programa en .net (o eso me das a entender) tiene más mérito si cabe.

Pero debo hacer un pequeño apunte sobre el código (con la intención de que le sirva a alguien para aprender, o al menos eso deseo), mira, para convertir un entero a un string binario simplemente puedes recurrir a la utilización de la función Convert.ToString, a uno de sus overloads que toma cómo parametro la base.

Ejemplo:
Código
  1. Clipboard.SetText(Convert.ToString(123456789I, toBase:=2)) ' Resultado: 111010110111100110100010101

Esta opción está muy bien para simplificar el código, pero lo cierto es que tu metodología también es buena en el sentido de que enseña "la base" de cómo hacerlo utilizando la aritmética, a la antigua usanza, sin aprovecharse de estas funciones built-in de .Net que tanto nos facilitan la vida en una linea de código. Así cómo tú has mostrado se aprende mejor a resolver problemas, pero bueno, quería dejar constancia de la alternativa, la Class Convert es muy útil.

Saludos!
« Última modificación: 22 Junio 2015, 13:23 pm por Eleкtro » En línea

tincopasan


Desconectado Desconectado

Mensajes: 1.286

No es lo mismo conocer el camino que recorrerlo.


Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #474 en: 22 Junio 2015, 17:57 pm »

Gracias por mostrar la forma simple de hacerlo, efectivamente no soy programador de ningún lenguaje en particular, pero usando la forma básica y conociendo las sentencias más comunes, if, then, for, while, etc. por ejemplo y de forma muy bruta resuelvo problemas en varios lenguajes, porque más allá de la riqueza de cada uno de ellos todos tienen la forma básica de empezar.
En línea

tincopasan


Desconectado Desconectado

Mensajes: 1.286

No es lo mismo conocer el camino que recorrerlo.


Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #475 en: 24 Junio 2015, 09:57 am »

Sigo revisando, son muchos! en la parte de criptografía vi un code que hace el cifrado de Cesar, obviamente lo haría más a lo bruto:

Código
  1. Dim Lista() As String = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "ñ", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
  2. Dim Adelante As Integer = 3    ' modificando este valor es cuantos lugares adelantamos para reemplazar
  3. Dim Letra As Char
  4. Dim x As Integer
  5. Dim cifrada As String = ""
  6.  
  7. Private Sub Cesar(palabra As String)
  8.    For i = 1 To Len(palabra)
  9.        Letra = GetChar(palabra, i)
  10.        For x = 0 To 26
  11.            If Letra = Lista(x) Then
  12.                x = (x + Adelante) Mod 27
  13.                Letra = CChar(Lista(x))
  14.                cifrada = cifrada + Letra
  15.                Exit For
  16.            End If
  17.        Next
  18.    Next
  19. MsgBox(cifrada)
  20. End Sub
  21. 'forma de uso
  22. Cesar("elhacker")
En línea

Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #476 en: 28 Junio 2015, 00:46 am »

Una refactorización de una Class que ya compartí para apagar, reiniciar, o desloguear un equipo local o en red.

Diagrama de Class:


Ejemplo de uso:
Código
  1.    Sub Test()
  2.  
  3.        ' Restart the current computer in 30 seconds and wait for applications to close.
  4.        ' Specify that the restart operation is planned because a consecuence of an installation.
  5.        Dim success As Boolean =
  6.            SystemRestarter.Restart("127.0.0.1", 30, "System is gonna be restarted quickly, go save all your data now...!",
  7.                                    SystemRestarter.ShutdownMode.Wait,
  8.                                    SystemRestarter.ShutdownReason.MajorOperatingSystem Or
  9.                                    SystemRestarter.ShutdownReason.MinorInstallation,
  10.                                    SystemRestarter.ShutdownPlanning.Planned)
  11.  
  12.        Console.WriteLine(String.Format("Restart operation initiated successfully?: {0}", CStr(success)))
  13.  
  14.        ' Abort the current operation.
  15.        If success Then
  16.            Dim isAborted As Boolean = SystemRestarter.Abort()
  17.            Console.WriteLine(String.Format("Restart operation aborted   successfully?: {0}", CStr(isAborted)))
  18.        Else
  19.            Console.WriteLine("There is any restart operation to abort.")
  20.        End If
  21.        Console.ReadKey()
  22.  
  23.        ' Shutdown the current computer instantlly and force applications to close.
  24.        ' ( When timeout is '0' the operation can't be aborted )
  25.        SystemRestarter.Shutdown(Nothing, 0, Nothing, SystemRestarter.ShutdownMode.ForceSelf)
  26.  
  27.        ' LogOffs the current user.
  28.        SystemRestarter.LogOff(SystemRestarter.LogOffMode.Wait)
  29.  
  30.    End Sub

Código fuente:
http://pastebin.com/FyH8U1ip
http://pastebin.com/3n9TbXB0 (corregido)

Fix:
El primer código no funcionaba, ya que al actualizar el código sin querer me equivoqué al escribir esto, lo dupliqué:
Citar
Código
  1. Private Shared ReadOnly privilegeNameOfShutdown As String = "SeRemoteShutdownPrivilege"
  2. Private Shared ReadOnly privilegeNameOfRemoteShutdown As String = "SeRemoteShutdownPrivilege"

Ya está corregido, resubido y testeado.
« Última modificación: 28 Junio 2015, 02:37 am por Eleкtro » En línea

tincopasan


Desconectado Desconectado

Mensajes: 1.286

No es lo mismo conocer el camino que recorrerlo.


Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #477 en: 29 Junio 2015, 21:18 pm »

muchas veces he tenido que hacer aplicaciones como facturas y lo que siempre queda bien o piden es que el número se pase a letras, una funcíon vieja que hace eso, estoy seguro que Elektro lo hace más fácil pero igual acá va:
Código
  1. Public Function NunAText(ByVal value As Double) As String
  2.        Select Case value
  3.            Case 0 : NunAText = "CERO"
  4.            Case 1 : NunAText = "UN"
  5.            Case 2 : NunAText = "DOS"
  6.            Case 3 : NunAText = "TRES"
  7.            Case 4 : NunAText = "CUATRO"
  8.            Case 5 : NunAText = "CINCO"
  9.            Case 6 : NunAText = "SEIS"
  10.            Case 7 : NunAText = "SIETE"
  11.            Case 8 : NunAText = "OCHO"
  12.            Case 9 : NunAText = "NUEVE"
  13.            Case 10 : NunAText = "DIEZ"
  14.            Case 11 : NunAText = "ONCE"
  15.            Case 12 : NunAText = "DOCE"
  16.            Case 13 : NunAText = "TRECE"
  17.            Case 14 : NunAText = "CATORCE"
  18.            Case 15 : NunAText = "QUINCE"
  19.            Case Is < 20 : NunAText = "DIECI" & NunAText(value - 10)
  20.            Case 20 : NunAText = "VEINTE"
  21.            Case Is < 30 : NunAText = "VEINTI" & NunAText(value - 20)
  22.            Case 30 : NunAText = "TREINTA"
  23.            Case 40 : NunAText = "CUARENTA"
  24.            Case 50 : NunAText = "CINCUENTA"
  25.            Case 60 : NunAText = "SESENTA"
  26.            Case 70 : NunAText = "SETENTA"
  27.            Case 80 : NunAText = "OCHENTA"
  28.            Case 90 : NunAText = "NOVENTA"
  29.            Case Is < 100 : NunAText = NunAText(Int(value \ 10) * 10) & " Y " & NunAText(value Mod 10)
  30.            Case 100 : NunAText = "CIEN"
  31.            Case Is < 200 : NunAText = "CIENTO " & NunAText(value - 100)
  32.            Case 200, 300, 400, 600, 800 : NunAText = NunAText(Int(value \ 100)) & "CIENTOS"
  33.            Case 500 : NunAText = "QUINIENTOS"
  34.            Case 700 : NunAText = "SETECIENTOS"
  35.            Case 900 : NunAText = "NOVECIENTOS"
  36.            Case Is < 1000 : NunAText = NunAText(Int(value \ 100) * 100) & " " & NunAText(value Mod 100)
  37.            Case 1000 : NunAText = "MIL"
  38.            Case Is < 2000 : NunAText = "MIL " & NunAText(value Mod 1000)
  39.            Case Is < 1000000 : NunAText = NunAText(Int(value \ 1000)) & " MIL"
  40.                If value Mod 1000 Then NunAText = NunAText & " " & NunAText(value Mod 1000)
  41.            Case 1000000 : NunAText = "UN MILLON"
  42.            Case Is < 2000000 : NunAText = "UN MILLON " & NunAText(value Mod 1000000)
  43.            Case Is < 1000000000000.0# : NunAText = NunAText(Int(value / 1000000)) & " MILLONES "
  44.                If (value - Int(value / 1000000) * 1000000) Then NunAText = NunAText & " " & NunAText(value - Int(value / 1000000) * 1000000)
  45.                'Case 1000000000000.0# : NunAText = "UN BILLON"
  46.                'Case Is < 2000000000000.0# : NunAText = "UN BILLON " & NunAText(value - Int(value / 1000000000000.0#) * 1000000000000.0#)
  47.                'Case Else : NunAText = NunAText(Int(value / 1000000000000.0#)) & " BILLONES"
  48.                '   If (value - Int(value / 1000000000000.0#) * 1000000000000.0#) Then NunAText = NunAText & " " & NunAText(value - Int(value / 1000000000000.0#) * 1000000000000.0#)
  49.        End Select
  50.  
  51.  
  52.    End Function

uso: NumAText(1897432)
En línea

crack81

Desconectado Desconectado

Mensajes: 222



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #478 en: 5 Julio 2015, 04:28 am »

Buenas queria preguntas si en este hilo solo se puede publicar codigo de vb y c# o tambien se puede de otro lenguajes

Ya que me he dado la tarea de traducir parte del codigo aqui ya publicado y otro mio en el lenguaje Delphi  o mejor lo pongo en otro post?
En línea

Si C/C++ es el padre de los lenguajes entonces ASM es dios.
Eleкtro
Ex-Staff
*
Desconectado Desconectado

Mensajes: 9.813



Ver Perfil
Re: Librería de Snippets para VB.Net !! (Compartan aquí sus snippets)
« Respuesta #479 en: 5 Julio 2015, 06:52 am »

Buenas queria preguntas si en este hilo solo se puede publicar codigo de vb y c# o tambien se puede de otro lenguajes

Ya que me he dado la tarea de traducir parte del codigo aqui ya publicado y otro mio en el lenguaje Delphi  o mejor lo pongo en otro post?

Este hilo es para publicar códigos de VisualBasic.Net, aunque .Net no es solamente VB.Net y C#, pero Delphi no forma parte de .Net, lo mejor será que crees un post en la sección de programación general.

Saludos!
En línea

Páginas: 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 [48] 49 50 51 52 53 54 55 56 57 58 59 Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines