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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [DUDA] Hacer frase aleatoria
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: [DUDA] Hacer frase aleatoria  (Leído 3,436 veces)
vivachapas


Desconectado Desconectado

Mensajes: 612



Ver Perfil
Re: [DUDA] Hacer frase aleatoria
« Respuesta #10 en: 9 Enero 2008, 17:33 pm »

sobre manejo de archivos mira este link... (lo es todo para mi xD) jja

http://www.recursosvisualbasic.com.ar/htm/tutoriales/tutorial-basico7.htm

SALUDOS


En línea

CesarTkgo69

Desconectado Desconectado

Mensajes: 19


Ver Perfil
Leer/Escribir Archivos INI
« Respuesta #11 en: 9 Enero 2008, 21:10 pm »

incrustarlo en el code lo hallo inexistente :xD
para darte nuevas ideas, otros caminos,
igual de interesante :) te dejo el codigo
de como leer y escribir archivos INI  ;D

En un Modulo inserta el siguiente codigo:

Código
  1. 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
  2. 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
  3.  
  4. Function ReadINI(strSection As String, strSetting As String, strDefault As String, strRuta As String)
  5.    Dim lngReturn As Long, strReturn As String, lngSize As Long
  6.    lngSize = 255
  7.    strReturn = String(lngSize, 0)
  8.    lngReturn = GetPrivateProfileString(strSection, strSetting, strDefault, strReturn, lngSize, strRuta)
  9.    If strReturn = "" Then
  10.        ReadINI = strDefault
  11.        WriteINI strSection, strSetting, strDefault
  12.    Else
  13.        ReadINI = LeftOf(strReturn, Chr(0))
  14.    End If
  15. End Function
  16.  
  17. Function WriteINI(strSection As String, strLValue As String, strRValue As String, strRuta As String)
  18.    Dim lngReturn As Long
  19.    lngReturn = WritePrivateProfileString(strSection, strLValue, strRValue, strRuta)
  20. End Function
  21.  
  22. Function LeftOf(strData As String, strDelim As String) As String
  23.    Dim intPos As Integer
  24.  
  25.    intPos = InStr(strData, strDelim)
  26.    If intPos Then
  27.        LeftOf = Left(strData, intPos - 1)
  28.    Else
  29.        LeftOf = strData
  30.    End If
  31. End Function
  32.  

En el Form:

Código
  1. Private Sub Command1_Click()
  2. ' Esta es la funcion para guardar el tip en el ini
  3.  
  4. WriteINI "Tips", "ID", Text1, App.Path & "Tips.ini"
  5.  
  6. End Sub
  7.  
  8. Private Sub Command2_Click()
  9. ' Y con este boton obtenemos los datos en el Text1
  10.  
  11. Text1 = ReadINI("Tips", "ID", "1", App.Path & "Tips.ini")
  12.  
  13. End Sub
  14.  

Ahi para que te entretengas adaptandolo jajajaja
duro trabajo xD

Suerte, Chauuuuuz ;D


En línea

Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Selección aleatoria en Combobox?
Desarrollo Web
CWeeD 2 3,344 Último mensaje 4 Febrero 2011, 00:20 am
por JungleBoogie
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines