SlideShare a Scribd company logo
1 of 4
ENTORNO VB
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Try
If TextBox1.Text = " " Then
MsgBox("ERROR FALTA NOMBRE USUSARIO")
Else
If TextBox2.Text = "" Then
MsgBox("FALTA CONTRASEÑA")
Else
Dim MENSAJE As New Net.Mail.MailMessage(TextBox1.Text,
TextBox3.Text, TextBox4.Text, TextBox5.Text)
Dim smtp As New Net.Mail.SmtpClient("smtp.live.con", 587)
Dim acceso As New Net.NetworkCredential(TextBox1.Text,
TextBox2.Text)
smtp.EnableSsl = True
smtp.Credentials = acceso
smtp.Port = 587
smtp.Host = "smtp.Live.com"
smtp.Send(MENSAJE)
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
Imports System.Net.Mail
Public Class Form1
Dim message As New MailMessage
Dim smtp As New SmtpClient
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
message.From = New MailAddress(TextBox1.Text)
message.To.Add(TextBox6.Text)
message.Body = TextBox5.Text
message.Subject = TextBox4.Text
smtp.EnableSsl = True
smtp.Port = "587"
smtp.Host = "smtp.gmail.com"
smtp.Credentials = New Net.NetworkCredential(TextBox1.Text,
TextBox2.Text)
smtp.Send(message)
MsgBox("mensaje enviado correctamente")
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
Imports Microsoft.Office.Interop.Word 'control de office
Imports System.IO 'sistema de archivos
Imports Microsoft.Office.Interop
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim MSWord As New Word.Application
Dim Documento As Word.Document
MsgBox("El TDR se guardará en : C:UsersafgarciaDesktopdocumento de
salida.docx")
FileCopy("C:plantilla video.docx", "C:UsersafgarciaDesktopdocumento
de salida.docx")
Documento = MSWord.Documents.Open("C:UsersafgarciaDesktopdocumento de
salida.docx")
Documento.Bookmarks.Item("nombre").Range.Text = txtnombre.Text
'Documento.Bookmarks.Item("apellido").Range.Text = txtapellido.Text
Documento.Bookmarks.Item("direccion").Range.Text = txtdireccion.Text
Documento.Bookmarks.Item("correo").Range.Text = txtcorreo.Text()
Documento.Bookmarks.Item("telefono").Range.Text = txttelefono.Text
Documento.Save()
MSWord.Visible = True
End Sub
End Class

More Related Content

What's hot

Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informaticamiguel camelo
 
Example esb file-to-string flow
Example esb file-to-string flowExample esb file-to-string flow
Example esb file-to-string flowAntonio Pellegrino
 
Mule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterMule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterGennaro Spagnoli
 
Qtp compare xml files
Qtp compare xml filesQtp compare xml files
Qtp compare xml filesRamu Palanki
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hoteldian pw
 
Input and output flow using file to string and logger component
Input and output flow using file to string and logger componentInput and output flow using file to string and logger component
Input and output flow using file to string and logger componentSon Nguyen
 
Imports my sql
Imports my sqlImports my sql
Imports my sqlobertksg
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger componentGermano Barba
 
AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals Adam Book
 

What's hot (17)

Ensayo Convergencia Informatica
Ensayo Convergencia InformaticaEnsayo Convergencia Informatica
Ensayo Convergencia Informatica
 
Example esb file-to-string flow
Example esb file-to-string flowExample esb file-to-string flow
Example esb file-to-string flow
 
Calculator code
Calculator codeCalculator code
Calculator code
 
Mule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converterMule esb How to use Jackson in Json to Object converter
Mule esb How to use Jackson in Json to Object converter
 
VB 6
VB 6VB 6
VB 6
 
Qtp compare xml files
Qtp compare xml filesQtp compare xml files
Qtp compare xml files
 
Reservasi hotel
Reservasi hotelReservasi hotel
Reservasi hotel
 
Input and output flow using file to string and logger component
Input and output flow using file to string and logger componentInput and output flow using file to string and logger component
Input and output flow using file to string and logger component
 
Muleesbobjecttojson
Muleesbobjecttojson Muleesbobjecttojson
Muleesbobjecttojson
 
Mule esb object_to_json
Mule esb object_to_jsonMule esb object_to_json
Mule esb object_to_json
 
Imports my sql
Imports my sqlImports my sql
Imports my sql
 
RegistryModClass
RegistryModClassRegistryModClass
RegistryModClass
 
Mule esb json_to_object
Mule esb json_to_objectMule esb json_to_object
Mule esb json_to_object
 
Codigo
CodigoCodigo
Codigo
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
 
Quanlycanbo
QuanlycanboQuanlycanbo
Quanlycanbo
 
AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals AWS Atlanta meetup CloudFormation conditionals
AWS Atlanta meetup CloudFormation conditionals
 

Similar to Ejercicios vb primer parcial

Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdfapnashop1
 
Lampiran source code
Lampiran source codeLampiran source code
Lampiran source codeancunk
 
Parra maxi IF THEN ELSE
Parra maxi IF THEN ELSEParra maxi IF THEN ELSE
Parra maxi IF THEN ELSEgabo2200
 
Christian rodriguez then else
Christian rodriguez then   elseChristian rodriguez then   else
Christian rodriguez then elsegabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 
Guevara rene if then., else
Guevara rene  if then., elseGuevara rene  if then., else
Guevara rene if then., elsegabo2200
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docxgabo2200
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganNurul Arhaiyyu
 

Similar to Ejercicios vb primer parcial (14)

Colegio municipal
Colegio municipalColegio municipal
Colegio municipal
 
Ficha tecnica
Ficha tecnicaFicha tecnica
Ficha tecnica
 
.net progrmming part4
.net progrmming part4.net progrmming part4
.net progrmming part4
 
Docimp
DocimpDocimp
Docimp
 
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
 
Lampiran source code
Lampiran source codeLampiran source code
Lampiran source code
 
Parra maxi IF THEN ELSE
Parra maxi IF THEN ELSEParra maxi IF THEN ELSE
Parra maxi IF THEN ELSE
 
Correction s+ rie_vb
Correction s+ rie_vbCorrection s+ rie_vb
Correction s+ rie_vb
 
Christian rodriguez then else
Christian rodriguez then   elseChristian rodriguez then   else
Christian rodriguez then else
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 
Guevara rene if then., else
Guevara rene  if then., elseGuevara rene  if then., else
Guevara rene if then., else
 
Federico landinez docx
Federico landinez docxFederico landinez docx
Federico landinez docx
 
Latihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/PerulanganLatihan visual basic 2010/Looping/Perulangan
Latihan visual basic 2010/Looping/Perulangan
 

Recently uploaded

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

Ejercicios vb primer parcial

  • 1. ENTORNO VB Imports System.Net.Mail Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try If TextBox1.Text = " " Then MsgBox("ERROR FALTA NOMBRE USUSARIO") Else If TextBox2.Text = "" Then MsgBox("FALTA CONTRASEÑA") Else Dim MENSAJE As New Net.Mail.MailMessage(TextBox1.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text) Dim smtp As New Net.Mail.SmtpClient("smtp.live.con", 587) Dim acceso As New Net.NetworkCredential(TextBox1.Text, TextBox2.Text) smtp.EnableSsl = True smtp.Credentials = acceso smtp.Port = 587 smtp.Host = "smtp.Live.com" smtp.Send(MENSAJE) End If
  • 2. End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class Imports System.Net.Mail Public Class Form1 Dim message As New MailMessage Dim smtp As New SmtpClient Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click message.From = New MailAddress(TextBox1.Text) message.To.Add(TextBox6.Text) message.Body = TextBox5.Text message.Subject = TextBox4.Text smtp.EnableSsl = True smtp.Port = "587" smtp.Host = "smtp.gmail.com" smtp.Credentials = New Net.NetworkCredential(TextBox1.Text, TextBox2.Text) smtp.Send(message) MsgBox("mensaje enviado correctamente") End Sub
  • 3. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class Imports Microsoft.Office.Interop.Word 'control de office Imports System.IO 'sistema de archivos Imports Microsoft.Office.Interop Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MSWord As New Word.Application Dim Documento As Word.Document
  • 4. MsgBox("El TDR se guardará en : C:UsersafgarciaDesktopdocumento de salida.docx") FileCopy("C:plantilla video.docx", "C:UsersafgarciaDesktopdocumento de salida.docx") Documento = MSWord.Documents.Open("C:UsersafgarciaDesktopdocumento de salida.docx") Documento.Bookmarks.Item("nombre").Range.Text = txtnombre.Text 'Documento.Bookmarks.Item("apellido").Range.Text = txtapellido.Text Documento.Bookmarks.Item("direccion").Range.Text = txtdireccion.Text Documento.Bookmarks.Item("correo").Range.Text = txtcorreo.Text() Documento.Bookmarks.Item("telefono").Range.Text = txttelefono.Text Documento.Save() MSWord.Visible = True End Sub End Class