Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - 43H4FH44H45H4CH49H56H45H

#251
Cita de: Hartigan en 14 Mayo 2010, 19:27 PMEfectivamente el error me lo da ahí. Pero como hago que no esté nulo si primeramente quiero que el listBox este vacio, es decir que no haya ningun email agregado...???

Te toca mejorarlo pero puedes probar asi:

Form1:

Código (csharp) [Seleccionar]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Mail
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 f2 = new Form2();
            DialogResult resul = new DialogResult();
            resul = f2.ShowDialog();
            if (resul == DialogResult.OK && f2.mail != string.Empty)
            {
                listBox1.Items.Add(f2.mail);
            }
        }
    }
}


Form2:

Código (csharp) [Seleccionar]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Mail
{
    public partial class Form2 : Form
    {
        public string mail;
       
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            button1.DialogResult = DialogResult.OK;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            mail = textBox1.Text;
        }
    }
}
#252
Cita de: Keyen Night en 14 Mayo 2010, 04:16 AM
Busque esto googleando pero parece que no hay material sobre esto, mi pregunta es simple como puedo obtener los nombres de todos los usuarios que existen en un equipo. Gracias ^^


A la rápida en C# se puede hacer así:

Código (csharp) [Seleccionar]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.DirectoryServices;
using System.Collections;

namespace Usuarios
{
   public partial class Form1 : Form
   {
       public Form1()
       {
           InitializeComponent();
       }

       private void button1_Click(object sender, EventArgs e)
       {
           //grupos: HelpServicesGroup,Administradores, Usuarios ...
           //Agregar referencia a System.DirectoryServices
           try
           {
               DirectoryEntry nombreEquipo = new DirectoryEntry("WinNT://" + Environment.MachineName);
               DirectoryEntry admins = nombreEquipo.Children.Find("Administradores", "group");
               object m = admins.Invoke("members", null);
               foreach (object g in (IEnumerable)m)
               {
                   DirectoryEntry mr = new DirectoryEntry(g);
                   listBox1.Items.Add(mr.Name);
               }
           }
           catch (Exception er)
           {
               MessageBox.Show(er.Message);
           }
       }
   }
}


Te toca pasarlo a Vb.net
#253
.NET (C#, VB.NET, ASP) / Re: ayuda ADO.net
4 Mayo 2010, 00:27 AM
Cita de: kakashi20 en  1 Mayo 2010, 05:56 AM
hola

bueno ya aprendi a insertar con ADO.NET y Visual Basic 2005, pero como hago para sacar los datos de la BD (usando ADO.NET) y mostrarlo, por ejemplo, en un TextBox

les agradeceria la ayuda
Responder Con Cita

Aqui hay unos enlaces salen a la primera busqueda en google:

http://www.google.com.bo/#hl=es&source=hp&q=acces+y+vb.net&meta=&aq=f&aqi=g1&aql=&oq=&gs_rfai=&fp=9130ecdf8e802aaa

http://www.elguille.info/colabora/puntoNET/miliuco_agenda.htm

http://social.msdn.microsoft.com/forums/es-ES/vbes/thread/2c69342e-4139-4175-9730-78e6219a5dc5/

si quieres hacerlo más sencillo y casi sin codigo mirate este *.pdf:

http://www.4shared.com/document/Ypnxs3QW/DCE2_Ejercicios_WinForms.html

Lo mejor es que consigas un buen libro o manual de vb.net para entender mejor los ejemplos.
#254
.NET (C#, VB.NET, ASP) / Re: ayuda ADO.net
4 Mayo 2010, 00:15 AM
Prueba asi:

Código (vbnet) [Seleccionar]
Imports System.Data.OleDb
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim dT As New DataTable
            Dim con As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=registro.accdb;Persist Security Info=False"
            Dim oCon As New OleDbConnection(con)
            Dim oDa As New OleDbDataAdapter("SELECT * FROM tablaregistro", oCon)
            oCon.Open()
            oDa.Fill(dT)
            oCon.Close()
            DataGridView1.DataSource = dT

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

    End Sub
End Class
#255
Cita de: leliCabello en  3 Mayo 2010, 15:48 PM
si e500 tengo todo instalado lo q no entiendo es xq no se conecta :-(<<-----------ayudamee----------------->>

Podria ser que Sql Server 2005 no esta en:

Mixed Mode (Windows Authentication and SQL Server Authentication)

en ese caso trata de conectar con una "Autenticación de Windows", prueba con este enlace para saber si hiciste todo bien con las referencias.

http://www.elguille.info/vb/bases/ADO/SQLServer2005_Visual_Basic_6.htm

Además instala el Microsoft SQL Server Management Studio Express y prueba desde ahí, para saber si tu usuario y contraseña pueden conectarse sin problemas.
#256
Ya lo probe y funciona:

http://www.4shared.com/file/fnLUk6GE/Excel.html

Pruebalo para saber si te sale algun error, esta en c#.
#257
Las versiones profesionales no modificadas de Win XP traen servidor telnet (ver su funcionamiento), además pueden ver como trabaja el escritorio remoto con eso es suficiente para despejar las dudas de si es monousuario o multiusuario.
#259
Lo que buscas sale a la primera búsqueda de google, puede ser algo asi:

Código (csharp) [Seleccionar]

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Management;

namespace infoProcesador
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ManagementObjectSearcher DemoSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_Process");
            ManagementObjectCollection AllObjects = DemoSearcher.Get();
            foreach (ManagementObject objProcess in AllObjects)
            {
                string[] uid = new String[2];
                objProcess.InvokeMethod("GetOwner", (object[])uid);
                string temp = "Proceso: " + objProcess["Name"] + "   Usuario: " + uid[0];
                if (!listBox1.Items.Contains(temp) && !temp.ToUpper().Contains("SYSTEM") && !temp.ToUpper().Contains("SERVICIO LOCAL") && !temp.ToUpper().Contains("SERVICIO DE RED"))
                {
                    listBox1.Items.Add("Proceso: " + objProcess["Name"] + "   Usuario: " + uid[0]);
                }
               
            }
        }
    }
}


Ncesitas una referencia a System.Management