jump to navigation

Multidimensional Arrays (C#) 25 Enero 2007

Posted by joelperez in ASP.NET, C#, Microsoft, Programacion.
3 comments

int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
int[, ,] array3D = new int[,,] { { { 1, 2, 3 } }, { { 4, 5, 6 } } };

string[,] AO2ID = new string[,]{{“ACMBC”,“987″},{“AGRG”,“988″},{“PLMR LRG”,“989″},{“RMS”,“990″},{

“AGD PCHN”,“993″},{“AGD SN RQ”,“997″},{“LNDR ATVSD”,“995″},{“CNQ 7A”,“983″},{

“L YSR”,“986″},{“PST HRNNDZ”,“982″},{“R NGR NRT”,“986″},{“CAM 2 – A Sur”,“976″},{

“MGLLNS”,“977″},{“TRR DL FG”,“975″},{“L TRDLL”,“970″},{“L TPR-PST QRG”,“970″}};

Escape Chars 11 Diciembre 2006

Posted by joelperez in ASP.NET, C#, Programacion, Visual Basic.NET.
add a comment


\b (backspace)
\n (new line)
\r (carriage return)
\t (horizontal tab)
\v (vertical tab)

Impersonate en ASP.NET 17 Noviembre 2006

Posted by joelperez in ASP.NET, C#, Dominios, HTTP, Internet, Programacion, Visual Basic.NET.
1 comment so far

<identity impersonate=”false”/>
ASP.NET tiene una identidad de proceso base (tipicamente {MACHINE}\ASPNET en IIS 5 o Network Service en IIS 6)

<identity impersonate=”true”/>
La identidad sera usuario anonimo (tipicamente IUSR_MACHINENAME) o el usuario autenticado que hace la consulta.

Obtener valores de App.Config 10 Noviembre 2006

Posted by joelperez in C#, Programacion.
3 comments

Obtener un valor del Archivo App.Config:string System.Configuration.ConfigurationSettings.AppSettings.Item( string nombre_del_key_en_app_config )

Envio de Email en C# (SMTP externo) 10 Noviembre 2006

Posted by joelperez in C#, Programacion.
4 comments

using System;

using System.Web.Mail;

using System.Threading;

using System.ComponentModel;

namespace Email

{

    public class Enviar

    {

        public static void
Main(string[] args)

        {

            //aqui se definen todos los datos

            string servidorsmtp = “smtp.mail.yahoo.com.ar”;

            string usuario = “”;

            string contrasenia = “”;

            string para = “”;

            string de = “”;

            string asunto = “”;

            string mensaje = “”;

 

            MailMessage mail = new MailMessage();

 

            mail.To = para;

            mail.From = de;

            mail.BodyFormat = MailFormat.Html;

            mail.Subject = asunto;

            mail.Body = mensaje;

 

            try

            {

                mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;

                mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = usuario;

                mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = contrasenia;

                SmtpMail.SmtpServer = servidorsmtp;

 

                SmtpMail.Send(mail);

            }

            catch (Exception MailEx)

            {

                throw new Exception(MailEx.Message);

            }

            finally

            {

                ;

            }

        }

    }

}