Escolar Documentos
Profissional Documentos
Cultura Documentos
Vliz Vilca
NR
O TEMA
VISUAL BASIC
MODO
1 CONSOLA
FORMULARIOS
2 Y CONTROLES
CLASES Y
3 OBJETOS
SE
MA CALE
NA NDAR
S
IOS
tareas
2 SET
2 SET
2 OCT
4 BASE DE DATOS
1 OCT
5 SQL
2 OCT
6 ADONET
ADO NET EN
7 WINDOWS
8 REPORTES
HERRAMIENTAS
9 WEB
DESARROLLO
10 DEL SISTEMA
EVALUACIONES
11 Y TRABAJOS
TOTAL
2 NOV
1.Cadena y archivos
2.menu y barra de
herramientas y
aplicaciones de
recursividad
3.clase definido por el
grupo
4. creacion de base de
datos y practica de SQL
-1-
FUENTE
Libro Visual Basic
2 NOV
1 DIC
1 DIC
1 DIC
1 DIC
17
6. revisar la parte de
porgrmacion del sistema dejado por le Ing Cruz
7.trabajo de
investigacion opcional
libre
-2-
Module Module1
Sub Main()
Console.Clear()
Console.SetCursorPosition(30, 12)
Console.ForegroundColor = 10
Console.BackgroundColor = 12
Console.Write("LETRA DE COLOR VERDE EN FONDO ROJO")
Console.ReadLine()
End Sub
End Module
ARCHIVOS
Escritura de archivo
Imports System.IO
-3-
Module Module1
Sub Main()
Dim swEscritor As StreamWriter
Dim NombreArchivo = "E:\DATOS\NOTAS.txt"
swEscritor = New StreamWriter(NombreArchivo)
swEscritor.Write("Ejemplo de archivo de texto")
swEscritor.WriteLine("Ingenieria Industrial")
swEscritor.WriteLine("2015")
swEscritor.Close()
Console.WriteLine(" archivo {0} grabado satisfactoriamente", NombreArchivo)
Console.ReadLine()
End Sub
End Module
Imports System.IO
Module Module1
Sub Main()
Dim swEscritor As StreamWriter
Dim Cadena As String
Dim NombreArchivo = "E:\DATOS\NOTAS1.txt"
swEscritor = New StreamWriter(NombreArchivo)
Console.WriteLine("ingrese lineas de texto vacio para terminar")
Cadena = Console.ReadLine()
Do While Not (Cadena = "")
swEscritor.WriteLine(Cadena)
Cadena = Console.ReadLine()
-4-
Loop
swEscritor.Close()
Console.WriteLine("Archivo grabado satisfactoriamente")
Console.ReadLine()
End Sub
End Module
B Lectura de Archivos
Imports System.IO
Module Module1
Sub main()
Dim srLector As StreamReader = New StreamReader("e:\DATOS\NOTAS.txt")
Dim Linea As String
Console.WriteLine("lectura de archivos")
Linea = srLector.ReadLine()
Do While Not (Linea Is Nothing)
Console.WriteLine(Linea)
Linea = srLector.ReadLine()
Loop
Console.ReadLine()
End Sub
End Module
-5-
Imports System.IO
Module Module1
Sub main()
Dim srLector As StreamReader = New StreamReader("e:\DATOS\NOTAS.txt")
Dim Linea As String
Dim ContLinea As Integer = 0
Dim Nletras As Integer = 0
Dim NroCar(26) As Integer
Dim contletras As Integer = 0
Console.WriteLine("Lectura de archivos")
Dim i, j As Integer
Linea = srLector.ReadLine()
Do While Not (Linea Is Nothing)
For i = 0 To 26 - 1
contletras = 0
For j = 0 To Len(Linea) - 1
If Linea(j) = Chr(65 + j) Then contletras = contletras + 1
Next
NroCar(i) = contletras
Next
Console.WriteLine(" {0}= nletras {1} contenido {2} ", ContLinea, Len(Linea), Linea)
Nletras = Nletras + Len(Linea)
Linea = srLector.ReadLine()
ContLinea = ContLinea + 1
Loop
Console.WriteLine("nro lineas {0}, nro letras {1} ", ContLinea, Nletras)
Console.WriteLine("FRECUENCIA DE LETRAS ")
For i = 0 To 26 - 1
Console.WriteLine("{0} = {1} ", Chr(65 + i), NroCar(i))
Next
Console.ReadLine()
End Sub
End Module
Agregar cuantos letras tiene el archivo
-6-
' *************modulo 2
Imports System.IO
Module Module2
Public Const maxcol As Integer = 40
-7-
-8-
-9-
- 10 -
- 11 -
SaveFileDialog1.ShowDialog()
NombreArchivo = SaveFileDialog1.FileName
GrabarMatriz(NombreArchivo, A, nf, nc)
MsgBox(" matriz grabada satisfactoriamente")
End Sub
Private Sub BtnSimular_Click(sender As Object, e As EventArgs) Handles
BtnSimular.Click
vel = Val(TextBox1.Text)
Timer1.Interval = vel
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
GenerarMatriz(A, nf, nc)
MostrarMatrizCuadricula(A, nf, nc)
btnGraficar_Click(sender, e)
TextBox2.Text = cont
cont = cont + 1
End Sub
Private Sub btnDetener_Click(sender As Object, e As EventArgs) Handles
btnDetener.Click
Timer1.Stop()
End Sub
Private Sub btncambiarColor_Click(sender As Object, e As EventArgs) Handles
btncambiarColor.Click
ColorDialog1.ShowDialog()
Me.BackColor = ColorDialog1.Color
btnIniciar.ForeColor = ColorDialog1.Color
End Sub
Private Sub btnCambiarLetra_Click(sender As Object, e As EventArgs) Handles
btnCambiarLetra.Click
FontDialog1.ShowDialog()
TextBox2.Font = FontDialog1.Font
btnIniciar.Font = FontDialog1.Font
End Sub
Private Sub btnDirectorio_Click(sender As Object, e As EventArgs) Handles
btnDirectorio.Click
Dim cadena As String
FolderBrowserDialog1.ShowDialog()
cadena = FolderBrowserDialog1.SelectedPath
Me.Text = cadena
End Sub
- 12 -
- 13 -
Imports System.IO
Module Module1
Public A(25000, 2) As String
Public nf As Integer
Sub LeerArchivo(A(,) As String, ByRef nf As Integer)
Dim srLector As StreamReader = New StreamReader("e:\DATOS\DIC1.txt")
Dim Linea As String
Dim cont As Integer = 0
Dim pos As Integer
Linea = srLector.ReadLine()
Do While Not (Linea Is Nothing)
pos = InStr(1, Linea, Chr(9))
A(cont, 0) = Mid(Linea, 1, pos - 1)
A(cont, 1) = Mid(Linea, pos + 1, Len(Linea))
cont = cont + 1
Linea = srLector.ReadLine()
Loop
- 14 -
nf = cont
End Sub
Sub BuscarInglesCastellano(A(,) As String, Ingles As String, nf As Integer)
Dim i As Integer
Dim largo As Integer
Dim cont1 As Integer = 0
For i = 0 To nf - 1
largo = InStr(A(i, 0), Ingles)
If largo > 0 Then
Console.WriteLine(" {0}===> {1} ====>{2}", cont1, A(i, 0), A(i, 1))
cont1 = cont1 + 1
End If
Next
Console.WriteLine("Palabras encontradas{0}", cont1)
End Sub
Sub BuscarCastellanoIngles(A(,) As String, Castellano As String, nf As Integer)
Dim i As Integer
Dim largo As Integer
Dim cont1 As Integer = 0
For i = 0 To nf - 1
largo = InStr(A(i, 1), Castellano)
If largo > 0 Then
Console.WriteLine(" {0}===> {1} ====>{2}", cont1, A(i, 1), A(i, 0))
cont1 = cont1 + 1
End If
Next
Console.WriteLine("Palabras encontradas{0}", cont1)
End Sub
Sub Main()
LeerArchivo(A, nf)
Dim opcion As Integer
Dim Ingles, Castellano As String
Do
Console.WriteLine("1. Ingles castellano 2. Castellano Ingles 3.Salir ")
Console.Write("ingrese opcion ")
opcion = Console.ReadLine()
Select Case opcion
Case 1
Console.WriteLine("Ingrese palabra en Ingls ")
Ingles = Console.ReadLine
BuscarInglesCastellano(A, Ingles, nf)
Case 2
Console.WriteLine("Ingrese palabra en Castellano ")
Castellano = Console.ReadLine
BuscarCastellanoIngles(A, Castellano, nf)
End Select
Loop While opcion <> 3
End Sub
End Module
ELABORAR MENU
RICHTEXTBOX
BARRA DE
HERRAMIENTAS
- 15 -
CON
EL
CONTROL