Saludos
Alex Taya
www.alextaya.com, ing.alextaya@outlook.com, Microsoft .Net, Visual Studio, Visual Basic, Visual C#, ASP.Net, Microsoft Office, Windows, etc.
The Windows 8 Enterprise 90-day evaluation is available to developers to build and test Windows 8 apps on the final version of Windows 8.
http://msdn.microsoft.com/es-ES/evalcenter/jj554510.aspx?wt.mc_id=MEC_132_1_4
Saludos.
Alex Taya.
Microsoft Visual Studio Express 2012 para Windows 8 es su herramienta para crear aplicaciones de Windows. Incluye el SDK de Windows 8, Blend para Visual Studio y plantillas de proyectos. Primero debe instalar Windows 8.
http://msdn.microsoft.com/es-ES/windows/apps/br229516
Saludos.
Alex Taya
La actualización del kit de desarrollo de software para Windows Phone 7.1.1 ofrece a los desarrolladores herramientas y opciones para ayudarles a desarrollar y probar aplicaciones para dispositivos Windows Phone de 256 MB.
Link ==> http://www.microsoft.com/es-es/download/details.aspx?id=29233
Saludos.
El Kit de desarrollo de software Windows Phone SDK 7.1 le ofrece todas las herramientas que necesita para desarrollar aplicaciones y juegos para dispositivos con Windows Phone 7.0 y Windows Phone 7.5.
Link ==> http://www.microsoft.com/es-es/download/details.aspx?id=27570
Saludos.
Hay días que el tráfico está en verdad terrible. Por fortuna, con la característica de tráfico de Windows Phone, podemos estar preparados. Como el gerente de programación (y por mucho tiempo geek de los mapas) responsable de la construcción de la aplicación Mapas, pensé en dar una rápida introducción a la opción de tráfico y resaltar algunas nuevas mejoras que se han hecho en las pasadas semanas.
Si aún no han probado revisar las más recientes condiciones de tráfico en su teléfono, abran Mapas, expandan el menú y toquen en ‘Mostrar Tráfico’.
Aprenda como las tecnologías de Visualización del estado de usuario de Microsoft (USV) pueden ayudar a las organizaciones a remplazar fácilmente entornos de PC alojados en el servidor y físicos, permitiendo por la agilidad del usuario final y continuidad de los negocios.
Visita ==> https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=es-AR&EventID=1032514100
Aprenda cómo implementar las aplicaciones de forma eficiente y a la vez inmediata en Windows 7, sin importar el escenario de migración nuevo o realizado a este nuevo sistema operativo. Abordaremos las formas de implementar aplicaciones con App-V y Remote App.
Visita ==> https://msevents.microsoft.com/CUI/EventDetail.aspx?culture=es-AR&EventID=1032514098
Las Herramientas de administración remota del servidor para Windows 8 Release Preview permiten a los administradores de TI administrar roles y características instaladas en equipos que ejecutan Windows Server 2012 desde un equipo remoto que ejecute Windows 8 Release Preview.
Visita ==> http://www.microsoft.com/es-es/download/details.aspx?id=28972
Los archivos ISO (.iso) de Windows 8 Release Preview se proporcionan como una alternativa al programa de instalación de Windows 8 Release Preview. Si trabajas en un equipo con Windows y quieres instalar la versión preliminar en otra partición, otro equipo o en una máquina virtual, te recomendamos que descargues el programa de instalación de Windows 8 Release Preview y uses las herramientas integradas para convertir una imagen ISO en un medio de instalación, como un DVD o una unidad flash USB de arranque. Encontrarás información adicional, incluida una lista de las actualizaciones admitidas, en la Ayuda.
Visita ==> http://windows.microsoft.com/es-XL/windows-8/iso?WT.mc_id=nlc-n-latam-ddp-DSK-Q4-SKI)
Esta carrera incluye los conceptos escenciales y funcionalidades básicas del producto de System Center Configuration Manager 2012.
Conocerán las características técnicas del producto y la forma por la cual se implementan las distintas funcionalidades que trae esta herramienta como por ejemplo toma de inventario de software, hardware, licenciamiento, instalación de software y updates, medición de uso de software concurrente, implementación de sistemas opertivos, manejo de aplicaciones y parches virtuales; entre otros.
Además, brindaremos la posibilidad de practicar mediante laboratorios virtules muchos de los temas expuestos.
La próxima versión de Windows Server, Windows Server 2012, ofrecerá a las empresas y a los proveedores de hospedaje una infraestructura optimizada para la nube, escalable, dinámica y multiempresa. Se conecta de manera segura en las instalaciones y ayuda a los profesionales de TI a responder a necesidades de negocio de manera más rápida y eficaz.
Windows Server 2012 Release Candidate (RC):
Visita ==> http://technet.microsoft.com/es-ES/evalcenter/hh670538?ocid=soc-n-latam-jtc-DPU-Q4-SKI
Windows reimaginado y renovado a partir de las solidas características de velocidad y seguridad de Windows 7. Disfruta de una interfaz táctil completamente nueva. Un nuevo Windows para nuevos dispositivos. Ahora tienes la oportunidad de ser uno de los primeros en probarlo.
¿Desea comprar un equipo nuevo o usado? Sepa lo que debe tener en cuenta antes de realizar la compra.
A la hora de comprar un equipo nuevo o usado, hay varios aspectos que se pueden comprobar rápidamente para asegurarse de que obtiene aquello por lo que paga:
Más información Visita ==> http://www.microsoft.com/es-xl/howtotell/Hardware.aspx#PCPurchase
Saludos.
Un libro Free sobre Introducción a SQL Server 2012
Descárgalo aquí ==> http://blogs.msdn.com/b/microsoft_press/archive/2012/03/15/free-ebook-introducing-microsoft-sql-server-2012.aspx
Saludos.
En el siguiente link encontrarán información para que puedan descargar la versión Express de Visual Studio.
Visita ==> http://www.microsoft.com/visualstudio/latam/products
Saludos.
Si estás navegando por internet y encuentras algo que te gusta y deseas compartirlo entonces esto te gustará, es un complemento de Internet Explorer que te permitirá realizar la acción de compartir en Facebook.
Visita ==> http://www.iegallery.com/en-US/Addons/Details/204
Saludos.
Hola amigos a continuación les presento una serie de pasos para poder instalar la aplicación de SkyDrive en su Computadora y así tener sincronizados sus datos.
Saludos.
2011-nov-29 12:18
|
Hace unos días que tenía pendiente escribir sobre una serie de novedades muy interesantes sobre los servicios Office 365.
Aquí encontrareis más detalle sobre todas ellas, pero me gustaría destacar las siguientes:
- Auto-servicio para el reseteo de contraseña del administrador - Plan P , Plan E
- Asistente para solucionar problemas - Do-It-Yourself (DIY) Troubleshooting support tool
- Posibilidad de desactivar y reactivar la sincronización de Active Directory (DirSync) - Plan E
- Soporte para Directory Synchronization tool 64-bit support - Plan E
- Acceso a usuarios externos vía Windows Live ID ( @live.com, @Hotmail.com, @msn.com y derivados de región)
- Sharepoint Business Connectivity Services (BCS)
- Mejora en la posibilidad de recuperación de colecciones de sitios de SharePoint Online
- Mejoras en el asistente para Agregar dominios
- Lync para Mac 2011 disponible para clientes Lync Online
- Página unificada de descargas para Mac - Plan P , Plan E
- Añadido soporte para navegadores (IE9 y Chrome) y OSX Lion
- ...
Además cabe recalcar que Office 365 se expande y está disponible para suscripción en 22 nuevos países !!!
SQL Server 2012 proporcionará confianza fundamental para sus objetivos con disponibilidad AlwaysOn, para obtener una conmutación por error más rápida, mayor utilización de hardware y ColumnStore en memoria para conseguir 10 veces el rendimiento de almacenamiento de datos. SQL Server 2012 también permite alcanzar un claro e innovador entendimiento con soluciones de inteligencia empresarial, tales como las asombrosas visualizaciones de datos interactivas de Power View y las mejoras para PowerPivot. Por último, SQL Server 2012 brindará una compatibilidad única a entornos de TI híbridos con administración común y herramientas de desarrollo, escalación elástica y extensión de aplicaciones directamente a la nube mediante SQL Azure.
Para obtener más información acerca de estas mejoras, consulte la página de detalles de producto.
Regístrese para obtener acceso a recursos de productos técnicos, como foros, aceleradores de soluciones, notas del producto y difusiones por web, en la página de recursos de SQL Server 2012.
Revise los requisitos de sistema de Microsoft SQL Server 2012 RC
Regístrese para la evaluación
Descargue e instale el software completo por un período de evaluación de 180 días
Reciba un correo electrónico de seguimiento con recursos que lo orienten
Use los blogs y los foros para compartir sugerencias
Información adicional:
¿Es usted una micro, pequeña, mediana o gran empresa? O forma parte
del sector público o educativo?
Sin importar cuál sea su perfil; encuentre fácilmente todas las formas de adquirir licenciamiento Microsoft, que se adapten a sus necesidades.
Visita ==> http://www.microsoft.com/latam/licenciamiento2011/default.aspx?page=videos
Preguntas y Respuestas sobre Windows Intune
Visita ==> http://www.microsoft.com/windows/windowsintune/windowsintune-faq.aspx
Descargate el Windows Developer Preview versión pre-beta de Windows 8 para desarrolladores.
Link ==> http://msdn.microsoft.com/es-PE/windows/apps/br229516/
Download the datasheets, white papers, videos and technical demos to help you evaluate SQL Server code-name "Denali" CTP3.
Según un análisis independiente hecho por la empresa de seguridad NSS Labs [PDF], IE9 es capaz de filtrar casi todo el malware y sitios maliciosos a los que se enfrenta, con una tasa de éxito de 99,2%.
Más ==> http://www.comunidadesmicrosoft.org/internet-explorer-9-el-navegador-m-s-seguro-del-mundo
Un video que demuestra la manera de remover el WIN32/FakePav, pensado para robar información relacionada a tarjetas de crédito. http://www.microsoft.com/showcase/en/us/details/36805b0e-80fa-41a7-81ee-1711eaec004d
Más de uno nos hemos roto en algún momento de nuestra vida la cabeza por querer desarrollar una rutina que nos permita convertir números a letras, es por ello que decidí compartir con todos uds. el presente artículo.
Consiste en una aplicación desarrollada en VB.Net apoyada con un módulo que recibe como parametro el valor ingresado y lo convierte en letras dependiendo si es positivo o negativo.
A continuación lo detallo en forma más específica:
Public Class FrmNumeroaletra
Inherits System.Windows.Forms.Form
'****************************************
'Desarrollado por: Pedro Alex Taya Yactayo
'Email: alextaya@hotmail.com
'Web: http://www.guiasyclasificados.com
' http://mugcanete.groups.live.com
'****************************************
#Region " Código generado por el Diseñador de Windows Forms "
Public Sub New()
MyBase.New()
'El Diseñador de Windows Forms requiere esta llamada.
InitializeComponent()
'Agregar cualquier inicialización después de la llamada a InitializeComponent()
End Sub
'Form reemplaza a Dispose para limpiar la lista de componentes.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Requerido por el Diseñador de Windows Forms
Private components As System.ComponentModel.IContainer
'NOTA: el Diseñador de Windows Forms requiere el siguiente procedimiento
'Puede modificarse utilizando el Diseñador de Windows Forms.
'No lo modifique con el editor de código.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents CmdConvertir As System.Windows.Forms.Button
Friend WithEvents TxtNumero As System.Windows.Forms.TextBox
Friend WithEvents TxtLetra As System.Windows.Forms.TextBox
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents credito As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmNumeroaletra))
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.CmdConvertir = New System.Windows.Forms.Button
Me.TxtNumero = New System.Windows.Forms.TextBox
Me.TxtLetra = New System.Windows.Forms.TextBox
Me.credito = New System.Windows.Forms.Label
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.Navy
Me.Label1.Location = New System.Drawing.Point(8, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(38, 18)
Me.Label1.TabIndex = 3
Me.Label1.Text = "Valor"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.ForeColor = System.Drawing.Color.FromArgb(CType(64, Byte), CType(0, Byte), CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(8, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(66, 18)
Me.Label2.TabIndex = 4
Me.Label2.Text = "En Letras"
'
'CmdConvertir
'
Me.CmdConvertir.BackColor = System.Drawing.Color.Navy
Me.CmdConvertir.Cursor = System.Windows.Forms.Cursors.Hand
Me.CmdConvertir.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.CmdConvertir.ForeColor = System.Drawing.Color.White
Me.CmdConvertir.Location = New System.Drawing.Point(232, 8)
Me.CmdConvertir.Name = "CmdConvertir"
Me.CmdConvertir.TabIndex = 1
Me.CmdConvertir.Text = "&Convertir"
'
'TxtNumero
'
Me.TxtNumero.Location = New System.Drawing.Point(88, 8)
Me.TxtNumero.Name = "TxtNumero"
Me.TxtNumero.Size = New System.Drawing.Size(128, 20)
Me.TxtNumero.TabIndex = 0
Me.TxtNumero.Text = ""
'
'TxtLetra
'
Me.TxtLetra.Location = New System.Drawing.Point(88, 40)
Me.TxtLetra.Name = "TxtLetra"
Me.TxtLetra.ReadOnly = True
Me.TxtLetra.Size = New System.Drawing.Size(456, 20)
Me.TxtLetra.TabIndex = 2
Me.TxtLetra.Text = ""
'
'credito
'
Me.credito.Font = New System.Drawing.Font("Microsoft Sans Serif", 6.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.credito.ForeColor = System.Drawing.Color.Green
Me.credito.Location = New System.Drawing.Point(312, 64)
Me.credito.Name = "credito"
Me.credito.Size = New System.Drawing.Size(232, 40)
Me.credito.TabIndex = 5
Me.credito.Text = "Desarrollado por: Pedro Alex Taya Yactayo alextaya@hotmail.com http:"//es.geociti" & _
"es.com/wiseman_alextaya"
Me.credito.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 500
'
'FrmNumeroaletra
'
Me.AcceptButton = Me.CmdConvertir
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(550, 100)
Me.Controls.Add(Me.credito)
Me.Controls.Add(Me.TxtLetra)
Me.Controls.Add(Me.TxtNumero)
Me.Controls.Add(Me.CmdConvertir)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "FrmNumeroaletra"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Convertir Número a Letra"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub CmdConvertir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdConvertir.Click
TxtLetra.Text = ""
If IsNumeric(TxtNumero.Text) Then
TxtLetra.Text = Letras(TxtNumero.Text)
Else
MessageBox.Show("Ingrese por favor números", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
TxtNumero.Focus()
TxtNumero.SelectionStart = 0
TxtNumero.SelectionLength = TxtNumero.ToString.Length
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static cColor As String
If cColor = "" Then
credito.ForeColor = System.Drawing.Color.Blue
cColor = "a"
Else
credito.ForeColor = System.Drawing.Color.Green
cColor = ""
End If
End Sub
End Class
Module aletras
'****************************************
'Desarrollado por: Pedro Alex Taya Yactayo
'Email: alextaya@hotmail.com
'Web: http://es.geocities.com/wiseman_alextaya
' http://groups.msn.com/mugcanete
'****************************************
Public Function Letras(ByVal numero As String) As String
'********Declara variables de tipo cadena************
Dim palabras, entero, dec, flag As String
'********Declara variables de tipo entero***********
Dim num, x, y As Integer
flag = "N"
'**********Número Negativo***********
If Mid(numero, 1, 1) = "-" Then
numero = Mid(numero, 2, numero.ToString.Length - 1).ToString
palabras = "menos "
End If
'**********Si tiene ceros a la izquierda*************
For x = 1 To numero.ToString.Length
If Mid(numero, 1, 1) = "0" Then
numero = Trim(Mid(numero, 2, numero.ToString.Length).ToString)
If Trim(numero.ToString.Length) = 0 Then palabras = ""
Else
Exit For
End If
Next
'*********Dividir parte entera y decimal************
For y = 1 To Len(numero)
If Mid(numero, y, 1) = "." Then
flag = "S"
Else
If flag = "N" Then
entero = entero + Mid(numero, y, 1)
Else
dec = dec + Mid(numero, y, 1)
End If
End If
Next y
If Len(dec) = 1 Then dec = dec & "0"
'**********proceso de conversión***********
flag = "N"
If Val(numero) <= 999999999 Then
For y = Len(entero) To 1 Step -1
num = Len(entero) - (y - 1)
Select Case y
Case 3, 6, 9
'**********Asigna las palabras para las centenas***********
Select Case Mid(entero, num, 1)
Case "1"
If Mid(entero, num + 1, 1) = "0" And Mid(entero, num + 2, 1) = "0" Then
palabras = palabras & "cien "
Else
palabras = palabras & "ciento "
End If
Case "2"
palabras = palabras & "doscientos "
Case "3"
palabras = palabras & "trescientos "
Case "4"
palabras = palabras & "cuatrocientos "
Case "5"
palabras = palabras & "quinientos "
Case "6"
palabras = palabras & "seiscientos "
Case "7"
palabras = palabras & "setecientos "
Case "8"
palabras = palabras & "ochocientos "
Case "9"
palabras = palabras & "novecientos "
End Select
Case 2, 5, 8
'*********Asigna las palabras para las decenas************
Select Case Mid(entero, num, 1)
Case "1"
If Mid(entero, num + 1, 1) = "0" Then
flag = "S"
palabras = palabras & "diez "
End If
If Mid(entero, num + 1, 1) = "1" Then
flag = "S"
palabras = palabras & "once "
End If
If Mid(entero, num + 1, 1) = "2" Then
flag = "S"
palabras = palabras & "doce "
End If
If Mid(entero, num + 1, 1) = "3" Then
flag = "S"
palabras = palabras & "trece "
End If
If Mid(entero, num + 1, 1) = "4" Then
flag = "S"
palabras = palabras & "catorce "
End If
If Mid(entero, num + 1, 1) = "5" Then
flag = "S"
palabras = palabras & "quince "
End If
If Mid(entero, num + 1, 1) > "5" Then
flag = "N"
palabras = palabras & "dieci"
End If
Case "2"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "veinte "
flag = "S"
Else
palabras = palabras & "veinti"
flag = "N"
End If
Case "3"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "treinta "
flag = "S"
Else
palabras = palabras & "treinta y "
flag = "N"
End If
Case "4"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "cuarenta "
flag = "S"
Else
palabras = palabras & "cuarenta y "
flag = "N"
End If
Case "5"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "cincuenta "
flag = "S"
Else
palabras = palabras & "cincuenta y "
flag = "N"
End If
Case "6"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "sesenta "
flag = "S"
Else
palabras = palabras & "sesenta y "
flag = "N"
End If
Case "7"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "setenta "
flag = "S"
Else
palabras = palabras & "setenta y "
flag = "N"
End If
Case "8"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "ochenta "
flag = "S"
Else
palabras = palabras & "ochenta y "
flag = "N"
End If
Case "9"
If Mid(entero, num + 1, 1) = "0" Then
palabras = palabras & "noventa "
flag = "S"
Else
palabras = palabras & "noventa y "
flag = "N"
End If
End Select
Case 1, 4, 7
'*********Asigna las palabras para las unidades*********
Select Case Mid(entero, num, 1)
Case "1"
If flag = "N" Then
If y = 1 Then
palabras = palabras & "uno "
Else
palabras = palabras & "un "
End If
End If
Case "2"
If flag = "N" Then palabras = palabras & "dos "
Case "3"
If flag = "N" Then palabras = palabras & "tres "
Case "4"
If flag = "N" Then palabras = palabras & "cuatro "
Case "5"
If flag = "N" Then palabras = palabras & "cinco "
Case "6"
If flag = "N" Then palabras = palabras & "seis "
Case "7"
If flag = "N" Then palabras = palabras & "siete "
Case "8"
If flag = "N" Then palabras = palabras & "ocho "
Case "9"
If flag = "N" Then palabras = palabras & "nueve "
End Select
End Select
'***********Asigna la palabra mil***************
If y = 4 Then
If Mid(entero, 6, 1) <> "0" Or Mid(entero, 5, 1) <> "0" Or Mid(entero, 4, 1) <> "0" Or _
(Mid(entero, 6, 1) = "0" And Mid(entero, 5, 1) = "0" And Mid(entero, 4, 1) = "0" And _
Len(entero) <= 6) Then palabras = palabras & "mil "
End If
'**********Asigna la palabra millón*************
If y = 7 Then
If Len(entero) = 7 And Mid(entero, 1, 1) = "1" Then
palabras = palabras & "millón "
Else
palabras = palabras & "millones "
End If
End If
Next y
'**********Une la parte entera y la parte decimal*************
If dec <> "" Then
Letras = palabras & "con " & dec
Else
Letras = palabras
End If
Else
Letras = ""
End If
End Function
End Module
Espero les sirva de algo esta rutina.
Hasta la próxima oportunidad.....:=)
Introducción
Casi siempre tenemos problemas cuando queremos trabajar ya sea con fechas u horas, creo yo que más de uno, nos hemos roto la cabeza tratando de solucionar este tipo de inconveniente, por ello he tratado de desarrollar este pequeño pero ilustrativo artículo donde muestro como podemos trabajar con estos tipos de datos en Visual Basic .Net.
Primero vamos recordar que dentro de SYSTEM (Espacio de Nombres) podemos localizar una serie de miembros que pueden ser Clases, Interfaces, Estructuras, Delegados y Enumeraciones que nos permiten realizar una serie de tareas, pero de quien nos vamos a centrar en este artículo es TIMESPAN (Estructura).
TimeSpan (Estructura)
Nos permite representar un intervalo de tiempo tomando como base una Fecha/Hora Inicial y una Fecha/Hora Final, devuelve la cantidad de Días, Horas, Minutos, Segundos, etc., transcurridos entre este intervalo de tiempo.
Hay que recordar la siguiente jerarquía.
System
System.Object
System.ValueType
System.TimeSpan
Estos son los requisitos para poder utilizarlo:
Espacio de Nombres: System
Plataformas: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional Edition, Familia de Windows Server 2003, .NET Compact Framework - Windows CE .NETEnsamblado: Mscorlib (en Mscorlib.dll)
....Bueno ahora vamos ha realizar lo que más nos agrada, que es un ejemplo de como hallar el intervalo de tiempo transcurrido entre dos fechas/horas:
Primero; realizamos lo que conocemos como Tiempo de Diseño:
Interfaz: Debemos de crear un formulario con los siguientes controles.
....Ahora vamos a ver como debe de quedar el Explorador de Soluciones:
Segundo; ahora vamos a tratar de describir lo que llamamos el Tiempo de Ejecución:
Public Class FrmInterDateTime
Inherits System.Windows.Forms.Form
Public flagestado As Boolean = False
#Region " Código generado por el Diseñador de Windows Forms "
Public Sub New()
MyBase.New()
'El Diseñador de Windows Forms requiere esta llamada.
InitializeComponent()
'Agregar cualquier inicialización después de la llamada a InitializeComponent()
End Sub
'Form reemplaza a Dispose para limpiar la lista de componentes.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Requerido por el Diseñador de Windows Forms
Private components As System.ComponentModel.IContainer
'NOTA: el Diseñador de Windows Forms requiere el siguiente procedimiento
'Puede modificarse utilizando el Diseñador de Windows Forms.
'No lo modifique con el editor de código.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents TxtDTInicio As System.Windows.Forms.TextBox
Friend WithEvents TxtDtFinal As System.Windows.Forms.TextBox
Friend WithEvents TxtDia As System.Windows.Forms.TextBox
Friend WithEvents TxtHra As System.Windows.Forms.TextBox
Friend WithEvents TxtMin As System.Windows.Forms.TextBox
Friend WithEvents TxtSeg As System.Windows.Forms.TextBox
Friend WithEvents TimerTitulo As System.Windows.Forms.Timer
Friend WithEvents TimerOpacity As System.Windows.Forms.Timer
Friend WithEvents TimerOpacity2 As System.Windows.Forms.Timer
Friend WithEvents CmdIntervalo As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmInterDateTime))
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.Label7 = New System.Windows.Forms.Label
Me.TxtDTInicio = New System.Windows.Forms.TextBox
Me.TxtDtFinal = New System.Windows.Forms.TextBox
Me.CmdIntervalo = New System.Windows.Forms.Button
Me.TxtDia = New System.Windows.Forms.TextBox
Me.TxtHra = New System.Windows.Forms.TextBox
Me.TxtMin = New System.Windows.Forms.TextBox
Me.TxtSeg = New System.Windows.Forms.TextBox
Me.TimerTitulo = New System.Windows.Forms.Timer(Me.components)
Me.TimerOpacity = New System.Windows.Forms.Timer(Me.components)
Me.TimerOpacity2 = New System.Windows.Forms.Timer(Me.components)
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 16.0!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.FontStyle), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.RoyalBlue
Me.Label1.Location = New System.Drawing.Point(63, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(210, 28)
Me.Label1.TabIndex = 8
Me.Label1.Text = "Intervalo de Tiempo"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.ForeColor = System.Drawing.Color.Crimson
Me.Label2.Location = New System.Drawing.Point(16, 48)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(96, 16)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Fecha/Hora Inicial"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.ForeColor = System.Drawing.Color.Crimson
Me.Label3.Location = New System.Drawing.Point(176, 48)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(91, 16)
Me.Label3.TabIndex = 2
Me.Label3.Text = "Fecha/Hora Final"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.ForeColor = System.Drawing.Color.Teal
Me.Label4.Location = New System.Drawing.Point(61, 96)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(31, 16)
Me.Label4.TabIndex = 3
Me.Label4.Text = "Días:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.ForeColor = System.Drawing.Color.Teal
Me.Label5.Location = New System.Drawing.Point(53, 120)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(39, 16)
Me.Label5.TabIndex = 4
Me.Label5.Text = "Horas:"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.ForeColor = System.Drawing.Color.Teal
Me.Label6.Location = New System.Drawing.Point(43, 144)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(49, 16)
Me.Label6.TabIndex = 5
Me.Label6.Text = "Minutos:"
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.ForeColor = System.Drawing.Color.Teal
Me.Label7.Location = New System.Drawing.Point(32, 168)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(60, 16)
Me.Label7.TabIndex = 6
Me.Label7.Text = "Segundos:"
'
'TxtDTInicio
'
Me.TxtDTInicio.Location = New System.Drawing.Point(16, 64)
Me.TxtDTInicio.Name = "TxtDTInicio"
Me.TxtDTInicio.Size = New System.Drawing.Size(144, 20)
Me.TxtDTInicio.TabIndex = 1
Me.TxtDTInicio.Text = "08/07/2004 08:00:00 a.m."
'
'TxtDtFinal
'
Me.TxtDtFinal.Location = New System.Drawing.Point(176, 64)
Me.TxtDtFinal.Name = "TxtDtFinal"
Me.TxtDtFinal.Size = New System.Drawing.Size(144, 20)
Me.TxtDtFinal.TabIndex = 2
Me.TxtDtFinal.Text = ""
'
'CmdIntervalo
'
Me.CmdIntervalo.ForeColor = System.Drawing.Color.Navy
Me.CmdIntervalo.Image = CType(resources.GetObject("CmdIntervalo.Image"), System.Drawing.Image)
Me.CmdIntervalo.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.CmdIntervalo.Location = New System.Drawing.Point(208, 112)
Me.CmdIntervalo.Name = "CmdIntervalo"
Me.CmdIntervalo.Size = New System.Drawing.Size(72, 56)
Me.CmdIntervalo.TabIndex = 0
Me.CmdIntervalo.Text = "&Hallar Intervalo"
Me.CmdIntervalo.TextAlign = System.Drawing.ContentAlignment.BottomCenter
'
'TxtDia
'
Me.TxtDia.Location = New System.Drawing.Point(96, 96)
Me.TxtDia.Name = "TxtDia"
Me.TxtDia.ReadOnly = True
Me.TxtDia.Size = New System.Drawing.Size(60, 20)
Me.TxtDia.TabIndex = 9
Me.TxtDia.Text = ""
Me.TxtDia.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'TxtHra
'
Me.TxtHra.Location = New System.Drawing.Point(96, 120)
Me.TxtHra.Name = "TxtHra"
Me.TxtHra.ReadOnly = True
Me.TxtHra.Size = New System.Drawing.Size(60, 20)
Me.TxtHra.TabIndex = 10
Me.TxtHra.Text = ""
Me.TxtHra.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'TxtMin
'
Me.TxtMin.Location = New System.Drawing.Point(96, 144)
Me.TxtMin.Name = "TxtMin"
Me.TxtMin.ReadOnly = True
Me.TxtMin.Size = New System.Drawing.Size(60, 20)
Me.TxtMin.TabIndex = 11
Me.TxtMin.Text = ""
Me.TxtMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'TxtSeg
'
Me.TxtSeg.Location = New System.Drawing.Point(96, 168)
Me.TxtSeg.Name = "TxtSeg"
Me.TxtSeg.ReadOnly = True
Me.TxtSeg.Size = New System.Drawing.Size(60, 20)
Me.TxtSeg.TabIndex = 12
Me.TxtSeg.Text = ""
Me.TxtSeg.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'TimerTitulo
'
Me.TimerTitulo.Enabled = True
Me.TimerTitulo.Interval = 300
'
'TimerOpacity
'
'
'TimerOpacity2
'
Me.TimerOpacity2.Enabled = True
'
'FrmInterDateTime
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(336, 200)
Me.Controls.Add(Me.TxtSeg)
Me.Controls.Add(Me.TxtMin)
Me.Controls.Add(Me.TxtHra)
Me.Controls.Add(Me.TxtDia)
Me.Controls.Add(Me.CmdIntervalo)
Me.Controls.Add(Me.TxtDtFinal)
Me.Controls.Add(Me.TxtDTInicio)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "FrmInterDateTime"
Me.Opacity = 0
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Intervalo de Tiempo - alextaya@hotmail.com "
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub FrmInterDateTime_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TxtDtFinal.Text = Now
End Sub
Private Sub VerInterDateTime(ByVal TSpan As TimeSpan)
TxtDia.Text = TSpan.Days.ToString
TxtHra.Text = TSpan.Hours.ToString
TxtMin.Text = TSpan.Minutes.ToString
TxtSeg.Text = TSpan.Seconds.ToString
End Sub
Private Sub TimerTitulo_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerTitulo.Tick
Me.Text = Microsoft.VisualBasic.Right(Me.Text, (Len(Me.Text) - 1)) + Microsoft.VisualBasic.Left(Me.Text, 1)
End Sub
Private Sub TimerOpacity_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerOpacity.Tick
Me.Opacity -= 0.05
If Me.Opacity = 0 Then
flagestado = True
Me.Close()
End If
End Sub
Private Sub FrmInterDateTime_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If flagestado = False Then
e.Cancel = True
Me.TimerOpacity.Enabled = True
End If
End Sub
Private Sub TimerOpacity2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerOpacity2.Tick
Me.Opacity += 0.05
If Me.Opacity = 1 Then
Me.TimerOpacity2.Enabled = False
End If
End Sub
Private Sub CmdIntervalo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdIntervalo.Click
Dim TSpan As TimeSpan
Dim DTInicio As DateTime
Dim DtFinal As DateTime
DTInicio = DateTime.Parse(TxtDTInicio.Text)
DtFinal = DateTime.Parse(TxtDtFinal.Text)
TSpan = DtFinal.Subtract(DTInicio).Duration
VerInterDateTime(TSpan)
End Sub
End Class
Ahora simplemente nos queda ejecutar la solución para ver que todo este bien, espero que funcione
sin ningún problema jeje ;).
Espero poder publicar un artículo similar pero utilizando C# en los próximos días.
Me despido esperando haber contribuido con un granito de arena en este fascinante mundo .Net. Nos vemos líneas de código más adelante.
These courses contain free technical training on emerging Microsoft products and technologies. Each course includes a set of videos, hands-on labs, and source code samples to get you up-to-speed quickly. Watch the videos to get an overview of the technology, then download the source code and follow along in a lab to get your hands on the technology.
Link: http://www.facebook.com/note.php?note_id=10150110122164756
Esta información lo publicó nuestro buen amigo Fernando García Loera.
Saludos.
La serie Springboard es el destino para recursos técnicos, herramientas gratuitas y consejos de expertos que le ayudarán a implementar y administrar Windows Internet Explorer en su organización.
Link: http://technet.microsoft.com/es-pe/ie/default.aspx
Saludos.
Más información ==> https://m.facebook.com/story.php?story_fbid=779713015547334&id=332220556963251