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

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Mensajes
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... 50
31  Programación / Programación Visual Basic / Re: Almacenar opcion de OptionButton en archivo ini en: 6 Diciembre 2013, 20:46 pm
Pues para eso existe funciones.

ejemplo esta simple.

Código
  1. dim Archivosdeprograma as string
  2.  
  3. 'C:\Archivos de programa\  o Archivos de programa (x86) respectivamente
  4. Archivosdeprograma=Environ$("ProgramFiles")


saludos
32  Programación / Programación Visual Basic / Re: Almacenar opcion de OptionButton en archivo ini en: 6 Diciembre 2013, 15:55 pm
Ups no me di cuenta que tenias un frame.  y los frames no tiene la propiedad value :S


cámbialo por este código.


Código
  1. Private Sub Form_Unload(Cancel As Integer)
  2. Dim Str As String
  3. Dim miOboton As Control
  4. Dim valorescribir As String
  5. Dim NombreArchivo As String
  6. NombreArchivo = App.Path & "\Config.ini"
  7.  
  8. 'Verificamos cual option buttons esta seleccionado
  9. For Each miOboton In Me.Controls
  10. If TypeOf miOboton Is OptionButton Then
  11. If miOboton.Value = True Then
  12. Select Case miOboton.Name
  13. Case "Option1"
  14. valorescribir = "1"
  15. Case "Option2"
  16. valorescribir = "2"
  17. Case "Option3"
  18. valorescribir = "3"
  19. End Select
  20. End If
  21. End If
  22. Next
  23. WriteIni NombreArchivo, "Opcion", "Valor", valorescribir
  24. End Sub
  25.  



saludos
33  Programación / Programación Visual Basic / Re: Almacenar opcion de OptionButton en archivo ini en: 6 Diciembre 2013, 14:09 pm
Hola. podrias hacer algo masomenos así:



Código
  1. '--------for INI file read/write
  2. Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
  3. Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
  4. '-------------------
  5.  
  6. 'reads ini string
  7. Public Function ReadIni(FileName As String, Section As String, Key As String) As String
  8. Dim RetVal As String * 255, v As Long
  9. v = GetPrivateProfileString(Section, Key, "", RetVal, 255, FileName)
  10. ReadIni = Left(RetVal, v)
  11. End Function
  12.  
  13.  
  14. 'writes ini
  15. Public Sub WriteIni(FileName As String, Section As String, Key As String, Value As String)
  16. WritePrivateProfileString Section, Key, Value, FileName
  17. End Sub
  18.  
  19.  
  20.  
  21.  
  22. Private Sub Form_Load()
  23. Dim valorleido As String
  24. Dim NombreArchivo As String
  25. NombreArchivo = App.Path & "\Config.ini"
  26.  
  27. If Dir(NombreArchivo) <> "" Then 'verificamos si existe el archivo pa' cuando abrimos por primera vez
  28. valorleido = ReadIni(NombreArchivo, "Opcion", "Valor")
  29. Select Case valorleido 'verificamos el valor leido y asignamos
  30. Case "1"
  31. Option1.Value = True
  32. Case "2"
  33. Option2.Value = True
  34. Case "3"
  35. Option3.Value = True
  36. End Select
  37. End If
  38. End Sub
  39.  
  40. Private Sub Form_Unload(Cancel As Integer)
  41. Dim Str As String
  42. Dim miOboton As Control
  43. Dim valorescribir As String
  44. Dim NombreArchivo As String
  45. NombreArchivo = App.Path & "\Config.ini"
  46.  
  47. 'Verificamos cual option buttons esta seleccionado
  48. For Each miOboton In Me.Controls
  49. If TypeOf miOboton Is OptionButton And miOboton.Value = True Then
  50. Select Case miOboton.Name
  51. Case "Option1"
  52. valorescribir = "1"
  53. Case "Option2"
  54. valorescribir = "2"
  55. Case "Option3"
  56. valorescribir = "3"
  57. End Select
  58. End If
  59. Next
  60. WriteIni NombreArchivo, "Opcion", "Valor", valorescribir
  61. End Sub
  62.  


Quizás lo complique un poco :S. pero funciona bien.  :laugh:
34  Programación / Java / Re: ayuda con archivos en java en: 5 Diciembre 2013, 21:35 pm
Hola no se java pero me parece que puedes hacer algo mas simple.

Código
  1.  String nombre = JOptionPane.showInputDialog(null, "ingrese el nombre");
  2.    File file = new File("File.txt");
  3.    FileInputStream fis = new FileInputStream(file);
  4.    byte[] data = new byte[(int)file.length()];
  5.    fis.read(data);
  6.    fis.close();
  7.  
  8.    //
  9.    String filestr = new String(data, "UTF-8");
  10.  
  11. if filetr.indexOf(nombre) {
  12.  
  13. PrintWriter writer = new PrintWriter("copia.txt", "UTF-8");
  14. writer.println("nombre);
  15. writer.close();
  16. }
  17.  


PD: el código no es funciona. solo es una idea.


saludos
35  Programación / Programación C/C++ / Re: Programar desde 0 un sistema operativo en C en: 5 Diciembre 2013, 16:04 pm
@ivancea96 jajajaja a demas de ese.

en fin si tienes tiempo pues no lo pierdas. ponte a estudiar.

aqui te dejo unas cosas a ver si de algo te sirven.

http://www.youtube.com/watch?v=6MJUGVFAXKg
' mira en la descripccion del video.

http://www.toaruos.org/

http://wiki.osdev.org/Main_Page

http://www.osdever.net/tutorials/

http://www.brokenthorn.com/Resources/OSDevIndex.html

Y bueno a leer como loco ;D  espero ver tu proyecto terminado.

saludos
36  Programación / Programación C/C++ / Re: Programar desde 0 un sistema operativo en C en: 5 Diciembre 2013, 15:42 pm
Vas a coger un código  fuente "libre" y modificar para que no puedan instalar mas aplicaciones :S ahí ya pierdes el concepto. lo estas privatizando.  :huh:

Haces un SOS no es tan fácil. se requieren años de programación. "real" no jugar con vb6  :laugh:

por ahí conozco de alguien que programo uno SOS todo en ASM le tomo varios años.


Igual suerte con el proyecto. dale duro.

saludos
37  Programación / Programación Visual Basic / Re: Ajustar contornos del frame a imagen en: 5 Diciembre 2013, 15:02 pm
Con este VB Shaped Form Creator lo puedes hacer fácil.

bájalo de aquí  http://www.byalexv.co.uk/


saludos
38  Programación / Ingeniería Inversa / Re: duda en: 3 Diciembre 2013, 14:17 pm
alguien me ayuda a cambiarle los créditos al PESS 2014  :laugh:

hay que implementar algún anti a la hora de crear un tema nuevo. leiste el F.A.Q, seguro leiste el F.A.Q, de verdad F.A.Q. no te creo en serio que leiste el F.A.Q.


saludos



39  Programación / Scripting / Re: [FUNCION] Autoit CMD Prompt en: 2 Diciembre 2013, 16:14 pm
Gracias por la función es muy útil.  no uses Dim ;)

saludos
40  Programación / Programación Visual Basic / Re: Com limpiar fila por fila en un listbox en: 2 Diciembre 2013, 15:55 pm
y el código? es invisible
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... 50
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines