|
Mostrar Temas
|
Páginas: 1 2 3 4 5 6 7 [8] 9
|
71
|
Programación / .NET (C#, VB.NET, ASP) / Reconocer areas de imagenes - ayuda
|
en: 25 Noviembre 2011, 17:57 pm
|
Una vez vi un programa que tenia una imagen y uno podia hacer click en distintas areas de la imagen y se obtenia un valor. Pero la imagen, ni las areas de la imagen eran cuadradas y menos redondas.
Existe algun boton u otro control que me permita hacer esto, en flash creo que se puede hacer, estoy buscando información para vb.net.
Saludos.
|
|
|
72
|
Programación / .NET (C#, VB.NET, ASP) / Problema Serializar/Deserializar
|
en: 23 Noviembre 2011, 07:18 am
|
Serializo y deserializo un objeto en un Proyecto1 sin ningun problema, pero cuando intento deserializar el objeto desde otro proyecto aún copiando la misma clase del objeto. Me sale un error que dice: No se pudo encontrar el ensamblado 'Proyecto1,versión=1.0.4344.1002,culture=neutral,PublicKeyToken=null'Parece que al guardar el objeto se crea esta especie de cabecera que referencia al proyecto que creo el archivo. Estoy intentando quitar esta cabecera, pienso que deberia poderse sobreescribiendo el metodo: Serealize. Alguien tiene alguna idea. Agredezco los comentarios.
|
|
|
74
|
Programación / Programación C/C++ / Seriales PenDrive DevC++ (SRC)
|
en: 17 Noviembre 2011, 17:27 pm
|
Buscando código para VB.NET encontré esto, hice pequeñas modificaciones para que funcione en Dev C++ y googleando encontré la función Split, comparto el resultado Hay que linkear: -lsetupapi #include <windows.h> #include <Setupapi.h> #include <stdio.h> static /*const*/ GUID hidGUID = { 0xA5DCBF10L, 0x6530, 0x11D2, { 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED } }; char **split ( char *string, const char sep) { char **lista; char *p = string; int i = 0; int pos; const int len = strlen (string); lista = (char **) malloc (sizeof (char *)); if (lista == NULL) { /* Cannot allocate memory */ return NULL; } lista[pos=0] = NULL; while (i <len) { while ((p[i] == sep) && (i <len)) i++; if (i <len) { char **tmp = (char **) realloc (lista , (pos + 2) * sizeof (char *)); if (tmp == NULL) { /* Cannot allocate memory */ free (lista); return NULL; } lista = tmp; tmp = NULL; lista[pos + 1] = NULL; lista[pos] = (char *) malloc (sizeof (char)); if (lista[pos] == NULL) { /* Cannot allocate memory */ for (i = 0; i <pos; i++) free (lista[i]); free (lista); return NULL; } int j = 0; for (i; ((p[i] != sep) && (i <len)); i++) { lista[pos][j] = p[i]; j++; char *tmp2 = (char *) realloc (lista[pos],(j + 1) * sizeof (char)); if (lista[pos] == NULL) { /* Cannot allocate memory */ for (i = 0; i <pos; i++) free (lista[i]); free (lista); return NULL; } lista[pos] = tmp2; tmp2 = NULL; } lista[pos][j] = '\0'; pos++; } } return lista; } HANDLE connectDeviceNumber(DWORD deviceIndex) { //GUID hidGUID; HDEVINFO hardwareDeviceInfoSet; SP_DEVICE_INTERFACE_DATA deviceInterfaceData; PSP_INTERFACE_DEVICE_DETAIL_DATA deviceDetail; ULONG requiredSize; HANDLE deviceHandle = INVALID_HANDLE_VALUE; DWORD result; //Get the HID GUID value - used as mask to get list of devices //HidD_GetHidGuid (&hidGUID); //hidGUID = new GUID(GUID GUID_DEVINTERFACE_USB_DEVICE); //Get a list of devices matching the criteria (hid interface, present) hardwareDeviceInfoSet = SetupDiGetClassDevs (&hidGUID, NULL, // Define no enumerator (global) NULL, // Define no (DIGCF_PRESENT | // Only Devices present DIGCF_DEVICEINTERFACE)); // Function class devices. deviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); //Go through the list and get the interface data result = SetupDiEnumDeviceInterfaces (hardwareDeviceInfoSet, NULL, //infoData, &hidGUID, //interfaceClassGuid, deviceIndex, &deviceInterfaceData); /* Failed to get a device - possibly the index is larger than the number of devices */ if (result == FALSE) { SetupDiDestroyDeviceInfoList (hardwareDeviceInfoSet); printf("hidin: -- failed to get specified device number"); return INVALID_HANDLE_VALUE; } //Get the details with null values to get the required size of the buffer SetupDiGetDeviceInterfaceDetail (hardwareDeviceInfoSet, &deviceInterfaceData, NULL, //interfaceDetail, 0, //interfaceDetailSize, &requiredSize, 0); //infoData)) //Allocate the buffer deviceDetail = (PSP_INTERFACE_DEVICE_DETAIL_DATA)malloc(requiredSize); deviceDetail->cbSize = sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA); //Fill the buffer with the device details if (!SetupDiGetDeviceInterfaceDetail (hardwareDeviceInfoSet, &deviceInterfaceData, deviceDetail, requiredSize, &requiredSize, NULL)) { SetupDiDestroyDeviceInfoList (hardwareDeviceInfoSet); free (deviceDetail); printf("hidin: -- failed to get device info"); return INVALID_HANDLE_VALUE; } char **listSplit; listSplit = split(deviceDetail->DevicePath,'#'); //printf("Opening device with path: %s", deviceDetail->DevicePath); printf("Serial: %s\n",listSplit[2] ); } int main(int argc, char* argv[]) { connectDeviceNumber(0); getchar(); return 0; }
|
|
|
75
|
Programación / .NET (C#, VB.NET, ASP) / (SOLUCIONADO SRC)Ayuda pasar codigo a VB.Net: Seriales Pen-Drives vb6
|
en: 10 Noviembre 2011, 17:32 pm
|
Estoy pasando un code a VB.net 2005 de Sergio Desanti (Hasseds) del foro VB6 : Seriales Pen-Drives http://foro.elhacker.net/programacion_visual_basic/seriales_de_pendrives_conectados_src-t331333.0.html EL problema es que entra en un bucle interminable, y tampoco estoy seguro si estoy utilizando bien las funciones del API Imports System.Runtime.InteropServices <StructLayout(LayoutKind.Sequential)> _ public structure SP_DEVICE_INTERFACE_DATA public cbSize as Long public InterfaceClassGuid as GUID public flags as Long public IntPtr as Long End Structure <StructLayout(LayoutKind.Sequential)> _ Public Structure SP_DEVINFO_DATA Public cbSize As UInteger Public ClassGuid As Guid Public DevInst As UInteger Public Reserved As IntPtr End Structure <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _ Public Structure SP_DEVICE_INTERFACE_DETAIL_DATA Public cbSize As UInt32 <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> _ Public strDevicePath As String End Structure ' SetupDiGetClassDevs: Retorna informacion sobre el dispositivo. <DllImport("setupapi.dll",EntryPoint:="SetupDiGetClassDevsW", SetLastError:=True, _ CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=True, _ CallingConvention:=CallingConvention.Winapi)> _ Private Shared Function SetupDiGetClassDevs( _ ByRef ClassGuid As GUID, _ ByVal Enumerator As Integer, _ ByVal hwndParent As Integer, _ ByVal Flags As Integer) As Integer End Function ' SetupDiEnumDeviceInterfaces <DllImport("setupapi.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _ Public Shared Function SetupDiEnumDeviceInterfaces(ByVal hDevInfo As IntPtr, _ ByRef devInfo As SP_DEVICE_INTERFACE_DATA, _ ByRef interfaceClassGuid As Guid, _ ByVal memberIndex As UInt32, _ ByRef deviceInterfaceData As SP_DEVICE_INTERFACE_DATA) As Boolean End Function ' SetupDiGetDeviceInterfaceDetail <DllImport("setupapi.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _ Public Shared Function SetupDiGetDeviceInterfaceDetail ( _ ByVal DeviceInfoSet As IntPtr, _ ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _ ByRef DeviceInterfaceDetailData As SP_DEVICE_INTERFACE_DETAIL_DATA, _ ByVal DeviceInterfaceDetailDataSize As UInteger, _ ByRef RequiredSize As UInteger, _ ByRef DeviceInfoData As SP_DEVINFO_DATA) As Boolean end function ' SetupDiDestroyDeviceInfoList <DllImport("setupapi.dll", _ EntryPoint:="SetupDiDestroyDeviceInfoList", _ SetLastError:=True, _ ExactSpelling:=True, _ PreserveSig:=True, _ CallingConvention:=CallingConvention.Winapi)> _ Private Shared Function SetupDiDestroyDeviceInfoList( _ ByVal DeviceInfoSet As Integer) As Boolean End Function '------CharSet:=CharSet.Auto ' <DllImport("ole32.dll", CharSet:=CharSet.Unicode,PreserveSig:=false)> _ ' static IIDFromString(lpsz as String) ' Funcion Public Function FlashSerials() As String Dim TGUID As GUID Dim lCount As Long Dim lSize As Long Dim DTL As new SP_DEVICE_INTERFACE_DETAIL_DATA Dim DTA As new SP_DEVICE_INTERFACE_DATA dim cad as String Dim strValue As String ="{a5dcbf10-6530-11d2-901f-00c04fb951ed}" ' esto era: Call IIDFromString(StrPtr("{a5dcbf10-6530-11d2-901f-00c04fb951ed}"), TGUID) ' pero no encuentro un equivalente en NET de IIDFromString ' encontre por ahi que se podia crear un Guid asi, estara bien? TGUID = New Guid(strvalue) Dim hDev As Long hDev = SetupDiGetClassDevs(TGUID, &H0, &H0, &H12) If hDev = -1 Then return "No hay nada" Exit Function End If DTA.cbSize = Len(DTA) DTL.cbSize = &H5 Dim dia As SP_DEVICE_INTERFACE_DATA dia.cbSize = &H0 Dim dd As SP_DEVINFO_DATA dd.cbSize = &H0 cad = "" lCount = 0 Dim nulo As new SP_DEVICE_INTERFACE_DETAIL_DATA ' Esto era asi 'do while not (SetupDiEnumDeviceInterfaces(hDev, &H0, TGUID, lCount, DTA) = &H0) ' Entra en un bucle interminable,que estoy haciendo mal? do While not SetupDiEnumDeviceInterfaces(hDev, dia , TGUID, lCount, DTA) ' Tengo mis dudas si estoy utilizando bien las funciones 'call SetupDiGetDeviceInterfaceDetail(hDev, DTA, ByVal &H0, &H0, lSize, ByVal &H0) Call SetupDiGetDeviceInterfaceDetail(hDev, dia, nulo , &H0, lSize, dd) ' Call SetupDiGetDeviceInterfaceDetail(hDev, DTA, DTL, ByVal lSize, &H0, ByVal &H0) call SetupDiGetDeviceInterfaceDetail(hDev, DTA, DTL, lSize, &H0, dd) If UBound(Split(DTL.strDevicePath, "#")) > 1 Then cad = cad & Split(UCase(DTL.strDevicePath), "#")(2) & Chr(&HD) End If lCount = lCount + 1 loop Call SetupDiDestroyDeviceInfoList(hDev) If cad = "" Then cad = "No hay conexiones" return cad End Function
Si alguien tiene sugerencias o alguna informacion sobre las funciones de la API que comento, se los agradeceria. Saludos.
|
|
|
76
|
Programación / Ingeniería Inversa / Consulta: Como hacer más dificil el crackeo?
|
en: 7 Octubre 2011, 22:11 pm
|
compilo en P-code. En mi programa pienso comparar el serial del disco duro o usb. Pienso poner el serial previamente obtenido en una variable y comparar en tiempo de ejecución 2 ó 3 veces.
Este método que tan dificil de crackear es? y si tendrían algunas sugerencias para hacerlo más dificil de crackear.
gracias por las sugerencias.
|
|
|
77
|
Programación / Programación Visual Basic / DUDA: Se puede serializar controles en VB6 ?
|
en: 4 Octubre 2011, 20:19 pm
|
Bueno estoy creando un aplicacion, y necesito salvar la informacion que se ingresa en los listbox, averiguando encontre la opción de serializar objetos. Y quisiera saber si se podrá serializar controles, deberia poderse, pienso yo. Bueno agredecere la información que puedan compartir, algun link, seguiré averiguando. Googleando encontre un ejemplo, pero no de controles lo probaré y si funciona lo subiré para compartir.
|
|
|
78
|
Informática / Hardware / MI pc se apaga cuando bootea el CD windows
|
en: 28 Septiembre 2011, 06:35 am
|
Se apaga cuando bootea de cd , asi que saque el disco duro y lo puse en otra pc e instale windows en la unidad C, sin tocar la D. Todo correcto, hasta que volvi a ponerlo en la 1er PC( Que se apaga cuando lee CD/DVD), ahora me da error y se reinicia cuando inicia windows. Ojala alguien tenga sugerencias, pues ya me dio mucho lio... Es una pentium IV o.0! gracias por las sugerencias.
|
|
|
79
|
Programación / Java / Doble buffer - Animación "Nieve" en java
|
en: 19 Junio 2011, 21:30 pm
|
La tecnica doble buffer nos permite hacer una animación libre de parpadeos, cuando llamas al método repaint() en un applet, este llama a update() el cual borra toda la pantalla y redibuja llamando al método paint(), esto lo hace directamente en la pantalla, por lo que se nota un feo parpadeo Para realizar el Doble Buffer, sobrescribimos el método update(), así relizaremos todo el pintado en una pantalla virtual asi no se visualizara hasta que nosotros volquemos esta pantalla virtual a la pantalla real. ejemplo //creamos una imagen buffer = createImage(Ancho, Alto); // creamos la pantalla virtual para el Doble Buffer pantallaVirtual = buffer.getGraphics();
Ahora todo lo que hagamos en la pantallaVirtual se verá reflejado en la imagen buffer, podemos pintar un círculo, rectangulo o una imagen previamente cargada en la pantallaVirtual. g.drawImage(fondo,0,0,this); // dibujamos el fondo g. setColor(new Color(240, 240, 255)); g.drawOval(10,10,200,200); } // dibujamos en la pantalla virtual, esto se hace en memoria // no se visualizara paint(pantallaVirtual); // se vuelca la imagen "buffer" en la pantalla real g.drawImage(buffer, 0, 0,640,400, this); }
Animación nieve: Nevando.java import java.awt.*; import java.util.Random; import java.util.Calendar; import java.applet.Applet; //Clase Nieve class Nieve { // coordenadas del copo de nieve int x, y; // indica la dirección // derecha = 1 ó izquierda = -1 int jock; //Constructor public Nieve(int a, int b, int c) { x = a; y = b; jock = c; } }//fin clase Nieve // Clase Nevando int Ancho=320, Alto = 200; public static final int MAX_COPOS = 250; Nieve copo[] = new Nieve[MAX_COPOS]; // matriz que representa a la pantalla virtual // para comprobar la posición de un copo int Tabla[][] = new int[Ancho][Alto]; boolean ok; // Constructor public Nevando() { try { ok = false; aleat = new Random(ahora. getTime(). hashCode()); } } public void iniciarTabla() { // inicializa la matriz con Ceros, porque esta vacia for(int j=0; j<Alto; j++) for(int i=0; i < Ancho; i++) Tabla[i][j] = 0; } // devuelve un numero entre "i" e "f" aletoriamente int aleatorio(int i, int f) { double random = aleat.nextDouble(); return ((int)((random*(f-i))+i)); } // devuelve 0 si la posicion esta libre // si la posicion esta ocupada devuelve 1 boolean comprobarTabla(int h, int k) { if(h>0 && k>0 && h<Ancho && k<Alto) if( Tabla[h][k] == 0) return true; return false; } //metodo init() propio del applet public void init() { iniciarTabla(); int k; // inicializamos los copos for(int j=0; j< MAX_COPOS; j++) { k = aleatorio(0,2); if(k==0) k = -1; // contruimos un nuevo copo copo[j] = new Nieve( aleatorio(0,Ancho),aleatorio(0,Alto) , k); Tabla[ copo[j].x ][ copo[j].y ] = 1; // representamos el copo en la matriz } try { // cargamos la imagen de fondo fondo = getImage(getCodeBase(),"imagenes/fondo.jpg"); //creamos una imagen de 320x200 pixels buffer = createImage(Ancho, Alto); // creamos la pantalla virtual para el Doble Buffer pantallaVirtual = buffer.getGraphics(); //tamaño del Applet 640x400 pixels resize(Ancho*2,Alto*2 ); } } public void stop() { hilo = null; } public void start() { if(hilo == null) { hilo.start(); } } // aquí pintamos todo la animacion g.drawImage(fondo,0,0,this); // dibujamos el fondo g. setColor(new Color(240, 240, 255)); // dibuja la nieve for(int i = 0; i < MAX_COPOS; i++) { g.fillOval(copo[i].x, copo[i].y, 2, 2); } } // todo lo que hagamos en "pantallaVirtual" se vera reflejado en // la imagen "buffer" // dibujamos en la pantalla virtual, esto se hace en memoria // no se visualizara paint(pantallaVirtual); // se vuelca la imagen "buffer" en la pantalla real g.drawImage(buffer, 0, 0,640,400, this); } // aqui realizamos todo el proceso de animacion public void run() { while(hilo != null) { // la logico de los copos for(int i=0; i<MAX_COPOS; i++) { // Si el copo aun no llega al suelo lo borramos if(copo[i].y < Alto-1) Tabla[copo[i].x][copo[i].y++] = 0; if(aleatorio(0,2)==0) // si es 0 movemos x copo[i].x += copo[i].jock*(-1); // Si el copo se sale de la pantalla, se crea uno nuevo if((copo[i].x <= 0) || (copo[i].x >= Ancho-1)) { copo[i].x = aleatorio(0,Ancho); copo[i].y = 0; Tabla[copo[i].x][copo[i].y] = 1; copo[i].jock = aleatorio(0,2); if (copo[i].jock == 0) copo[i].jock = -1; } // Si ok=1 significara que el copo aun esta dentro de la pantalla ok=((copo[i].x>=0) && (copo[i].x<Ancho) && (copo[i].y>=0) &&(copo[i].y<Alto)); // "Esto es para que el copo caiga si esta en algun objeto" // Vemos el punto central if(comprobarTabla( copo[i].x , copo[i].y ) && ok) Tabla[ copo[i].x ][ copo[i].y ] = 1; // Vemos el punto derecha-abajo else if(comprobarTabla(copo[i].x+1, copo[i].y+1) && ok) Tabla[copo[i].x++][copo[i].y++] = 1; // Vemos el punto izquierda-abajo else if(comprobarTabla(copo[i].x-1,copo[i].y+1) && ok) Tabla[copo[i].x--][copo[i].y++] = 1; // Vemos el punto central-abajo else if(comprobarTabla(copo[i].x,copo[i].y+1) && ok) Tabla[copo[i].x][copo[i].y++] = 1; else // Si no esta en ningun borde, lo dejamos en ese sitio { // y creamos nuevo copo if(ok) { Tabla[copo[i].x][copo[i].y-1] = 1; copo[i].x = aleatorio(0,Ancho); copo[i].y = 0; Tabla[copo[i].x][copo[i].y] = 1; copo[i].jock = aleatorio(0,2); if(copo[i].jock == 0) copo[i].jock = -1; } } } repaint(); // llama al metodo Update try{hilo.sleep(20);} // para el proceso por 20/1000 segundos } } }
Aqui el proyecto en Netbeans 5.5 de la animación de nieve en java, tiene comentarios http://www.mediafire.com/?x69b70m1s74bds3
|
|
|
80
|
Seguridad Informática / Hacking / Web spoofing - ayuda
|
en: 11 Junio 2011, 10:36 am
|
Estoy investigando, asi que si alguien tiene información que me permita hacer la suplantación en windows se lo agradecería leyendo se que DNS spoofing con el Cain es fácil, bueno capturaría los pass con el Cain porque si funciona el envenamiento arp, pero el problema es que la pagina que quiero suplantar utiliza algoritmo md5 para cifrar el pass, como soy poco paciente para hallar el pass por fuerza bruta , quiero probar la web spoofing. Agradecería referencias, algo leí que se puede instalar el servidor web como apache¿? pero como hacer para que el usuario cuando escriba por ejemplo www.google.com lo redireccione a mi pc? fácilmente notará la diferencia?
|
|
|
|
|
|
|