Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ejercicio basico en asp.net LOZADA ERICK

437 views

Published on

Aplicacion basica desde ASP.NET

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Ejercicio basico en asp.net LOZADA ERICK

  1. 1. Aplicación básica de ASP.NET La aplicación consiste sacar el promedio de 4 valores numéricos Codificación Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _ <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class ServicioApp Inherits System.Web.Services.WebService <WebMethod()> _ Public Function Promedio(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer, ByVal a As Integer) As Integer Return (x + y + z + a) / 2 End Function End Class Public Class WebApp Protected Sub BtnPromedio_Click(sender As Object, e As EventArgs) Handles BtnPromedio.Click Dim x, y, z, a As Integer Dim c As Integer Dim MathPromedio As New Localhost.Service() x = Integer.Parse(TextBox1.Text) y = Integer.Parse(TextBox2.Text) z = Integer.Parse(TextBox3.Text) a = Integer.Parse(Textbox0.Text) c = MathPromedio.(x, y, z, a) TxtResp.Text = c.ToString End Sub End Class Diseño Se importanestaslibrerías para un servicioweb Se declara una clase particular para habilitar todos los métodos y eventos Esta función permite retornar 4 variables para visualizar el promedio. Se declaran 4 variables de tipo entero Las 4 variablesse aclaransustiposenteros Este resultadolotransformoencadenade caracteres

×