domingo, 29 de diciembre de 2013

C# - Apps - MxPing - Download


Esta aplicación puede enviar hasta 100 procesos al mismo tiempo para testear el enlace de Internet o red local.
This application can send up to 100 processes simultaneously to test The Internet link or local network.


Donwload: MxPing
Donwload: Net Framework 2.0

martes, 12 de febrero de 2013

C# - Algoritmos - Conexión en Firebird (2005, 2008)

La clase Class_Connection.class
using FirebirdSql.Data.FirebirdClient;
using System;
using System.Data;
using System.IO;
using System.Configuration;
using System.Windows.Forms;
using System.Xml;

public class Class_Connection {
    private FbConnection Fb_Connection;

    public string Fb_ConnectionTXT() {
        StreamReader objReader = new StreamReader("\\FirebirdCN\\Firebird.txt");
        String ConnectionString;
        ConnectionString = "";
        ConnectionString = objReader.ReadLine();
        return ConnectionString;
    }

    public String Fb_ConnectionXML() {
        XmlDocument Xml;
        XmlNodeList NodeList;
        String ConnectionString = "";
        Xml = new XmlDocument();
        Xml.Load(Application.StartupPath + "\\FirebirdCN\\Firebird.xml");
        NodeList = Xml.SelectNodes("/FirebirCN");
        foreach (XmlNode Node in NodeList) {
            ConnectionString = ConnectionString + Node.ChildNodes.Item(0).Name + "=" + Node.ChildNodes.Item(0).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(1).Name + "=" + Node.ChildNodes.Item(1).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(2).Name + "=" + Node.ChildNodes.Item(2).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(3).Name + "=" + Node.ChildNodes.Item(3).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(4).Name + "=" + Node.ChildNodes.Item(4).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(5).Name + "=" + Node.ChildNodes.Item(5).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(6).Name + "=" + Node.ChildNodes.Item(6).InnerText + "; ";
            ConnectionString = ConnectionString + Node.ChildNodes.Item(7).Name + "=" + Node.ChildNodes.Item(7).InnerText;
        }
        return ConnectionString;
    }

    public void Fb_Open() {
        try {
            Fb_Connection = new FbConnection();
            Fb_Connection.ConnectionString = Fb_ConnectionXML();
            Fb_Connection.Open();
        } catch (InvalidCastException e) {
            MessageBox.Show("Unable to establish the Connection to the server");
        }
    }

    public void Fb_Close() {
        Fb_Connection.Close();
    }

    public void Fb_Execute(String SQL) {
        try {
            Fb_Open();
            FbCommand cmd = new FbCommand(SQL, Fb_Connection);
            cmd.ExecuteNonQuery();
            Fb_Close();
        } catch (InvalidCastException e) {
            MessageBox.Show("Unable to establish the Connection to the server");
        }
    }

    public DataTable Fb_DataTable(String SQL) {
        DataTable dt = new DataTable();
        try {
            Fb_Open();
            FbDataAdapter da = new FbDataAdapter(SQL, Fb_Connection);
            da.Fill(dt);
            Fb_Close();
        } catch (InvalidCastException e) {
            MessageBox.Show("Unable to establish the Connection to the server");
        }
        return dt;
    }

    public DataSet Fb_DataSet(String SQL) {
        DataSet dt = new DataSet();
        try {
            Fb_Open();
            FbDataAdapter da = new FbDataAdapter(SQL, Fb_Connection);
            da.Fill(dt, "Table");
            Fb_Close();
        } catch (InvalidCastException e) {
            MessageBox.Show("Unable to establish the Connection to the server");
        }
        return dt;
    }

}


El contenido del alchivo TXT
ServerType=0; User=SYSDBA; Password=masterkey; database=127.0.0.1:C:\LIMPIA.FDB; charset=UTF8
User=SYSDBA; Password=masterkey; DataSource=localhost; Database=C:\LIMPIA.FDB; Charset=UTF8; Port=; Pooling=true; ServerType=0


El Contenido del archivo XML
<?xml version="1.0" encoding="UTF-8"?>
<FirebirCN>
  <User>TheUser</User>
  <Password>ThePassword</Password>
  <Server>TheServer</Server>
  <Database>C:\Database.FDB</Database>
  <Charset>UTF8</Charset>
  <Port> </Port>
  <Pooling>false</Pooling>
  <ServerType>0</ServerType>
</FirebirCN>


Añadir referencias a las siguientes librerías

Download: FirebirdSql.Data.FirebirdClient.dll
Download: FirebirdDataAccess.Zhero.dll

lunes, 11 de febrero de 2013

C# - Algoritmos - Convertir Bytes a Imagen (2005, 2008)

using System.Drawing;

private Image Get_IMAGE(Byte[] ImageB) {
    Image ImageR = null;
    if (ImageB != null)
        if (ImageB.Length > 0) {
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            ms.Write(ImageB, 0, ImageB.GetUpperBound(0) + 1);
            ImageR = System.Drawing.Image.FromStream(ms);
        }

    return ImageR;
}

domingo, 10 de febrero de 2013

C# - Algoritmos - Convertir Imagen a Bytes (2005, 2008)

using System.Drawing;

private Byte[] Get_IMAGE(Image ImageR) {
    Byte[] ImageB = null;
    if (ImageR != null)
        try {
            using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) {
                ImageR.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                ImageB = ms.ToArray();
            }
        } catch (Exception) {
            throw;
        }
    return ImageB;
}

jueves, 7 de febrero de 2013

Firebird - Procedimientos - Llenar un campo tipo BLOB con una imagen

SET TERM ^ ;
CREATE PROCEDURE UPDATE_IMAGE(
    CVE_REG VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8,
    IMAGE BLOB)
RETURNS( RETVAL SMALLINT )
AS
BEGIN
    UPDATE CAT_IMAGES 
        SET CAT_IMAGES.IMAGE = :IMAGE 
        WHERE CAT_IMAGES.CVE_REG = :CVE_REG;
    SUSPEND;
END^

SET TERM ; ^

miércoles, 6 de febrero de 2013

C# - Algoritmos - Llenar DataSet Manualmente (2005, 2008)

private void Fill_DataSet() {
    DataSet ds = new DataSet();

    ds.Tables.Add("0");
    ds.Tables["0"].Columns.Add("Campo_1", Type.GetType("System.String"));
    ds.Tables["0"].Columns.Add("Campo_2", Type.GetType("System.String"));
    ds.Tables["0"].Columns.Add("Campo_3", Type.GetType("System.String"));

    DataRow row = ds.Tables["0"].NewRow();

    row["Campo_1"] = "Rafael";
    row["Campo_2"] = "Méndez";
    row["Campo_3"] = "Mazariego";
    ds.Tables["0"].Rows.Add(row);

    ds.Tables["0"].AcceptChanges();
    DataGridView1.DataSource = ds.Tables["0"];
}

miércoles, 2 de enero de 2013

C# - Algoritmos - Cadenas Aleatorias (2005, 2008)

using System;
using System.Text;

public string RandomString(int size) {
    StringBuilder builder = new StringBuilder();
    Random random = new Random();
    char ch;
    for (int i = 0; i < size; i++) {
        ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
        builder.Append(ch);
    }
    return builder.ToString();
}

miércoles, 26 de diciembre de 2012

C# - Apps - Mx-Menu - Download




Este es un programa creado en el lenguaje C-Sharp con la finalidad de facilitar la creación de menús desplegables que sean compatibles con las distintas plantillas de Blogger; paralelamente puede ser utilizado para crear menús de paginas webs.

Actualmente solo se facilita un tipo de menú, pero se puede configurar la mayoría de su aspecto, ya sean los colores de fondo, ancho del menú y submenus, colores de fuente, alienación de los submenus, etc. Cabe destacar que el menú es de tipo multinivel, es decir que pueden añadirse la cantidad de subniveles que sean necesarios. 

This is a program created in C-Sharp in order to facilitate the creation of menus that are compatible with the different templates Blogger; parallel can be used to create menus for web pages.

Currently only facilitates a type of menu, but you can configure most of the appearance, such as the background colors, menu's width, submenu's widths, font colors, alienation of the submenus, etc. Note that the menu is multi-level, ie the amount of sublevels may be added as necessary .




Donwload: Mx-Menu
Donwload: Net Framework 2.0

martes, 25 de diciembre de 2012

VB.NET - Apps - Download - AutoTecleo - (2005, 2008)




Esta aplicación permite escribir automáticamente lineas de texto en alguna entrada para ello, como puede ser "Bloc de Notas", "Microsoft Word", algún tipo de Chat, la Linea de comandos del DOS, Etc.

Comprobado en Windows 7, salvo que el anti-virus puede malinterpretar este. El programa ejecutable lo pueden encontrar en la ruta: "NombreApp/NombreApp/Bin/Debug/NombreApp.Exe"


Como usarlo?

1. Ejecutar el programa
2. Escribir las lineas de texto que desean Auto-Escribir
3. Establecer numero de veces que se repetirá el mensaje
4. Establecer el intervalo de tiempo entre cada linea
5. Posicionar el cursor en donde se comenzara a Auto-Escribir el mensaje

This application can automatically write lines of text on some entry for it, such as "Notepad", "Microsoft Word", some kind of Chat, the DOS command line, Etc.

Tested on Windows 7, except that the anti-virus may misinterpret this. The executable program can be found on the route: "NameApp / NameApp / bin / Debug / NameApp.Exe"


How to use?

1. Run the program
2. Write lines of text to be Auto-Write
3. Set number of times to repeat the message
4. Set the time interval between each line
5. Position the cursor where you started Auto-Write the message

Download: NET - 2005 - AutoTecleo - V1.0 - VB
Download: NET - 2008 - AutoTecleo - V1.0 - VB

VB.NET - Apps - Código - AutoTecleo - (2005, 2008)

Public Class frm_Main
    'craneodelrey@msn.com

    Public Send_Keys As Boolean 'Inicia o Detiene el AutoTecleo

    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    'Declaración de la función GetAsyncKeyState que se usa para leer la pulsación de las teclas F7 y F8
    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    <System.Runtime.InteropServices.DllImport("user32.dll", ExactSpelling:=True, CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _
    Public Shared Function GetAsyncKeyState(ByVal vkey As Integer) As Short
    End Function
    '----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>


    Private Sub frm_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Send_Keys = False
        Me.TransparencyKey = Color.LightGray
    End Sub

    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    'Iniciar el AutoTecleo estableciendo Send_Keys = True, luego cambia a un tiempo de espera largo para
    'no interferir durante el proceso de AutoTecleo
    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    Private Sub tmr_Timer_1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_Timer_1.Tick
        Dim Key_State As Integer
        Me.tmr_Timer_1.Interval = 10
        Key_State = GetAsyncKeyState(Keys.F7)

        If Key_State < 0 Then
            Me.Send_Keys = True
            Me.tmr_Timer_1.Interval = (60) * (60) * (1000)
            Me.AutoSendKeys()
        End If
    End Sub
    '----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>


    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    'Tratar de finalizar e interrumpir el proceso de AutoTecleo estableciendo Send_Keys = False
    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    Private Sub tmr_Timer_2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_Timer_2.Tick
        Dim Key_State As Integer
        Key_State = GetAsyncKeyState(Keys.F8)
        If Key_State < 0 Then
            Me.Send_Keys = False
        End If
    End Sub
    '----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>

    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    'Función que realiza el AutoTecleo
    '<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----<<><<>----
    Private Sub AutoSendKeys()
        Dim Times, Lines, Count, i As Int32
        Dim Interval As Decimal
        Dim Errors As String
        Dim MessageArray() As String

        Times = Convert.ToInt32(Me.nud_Times.Value.ToString())
        Interval = Convert.ToDecimal(Me.nud_Interval.Value.ToString())
        Lines = Me.txt_Message.Lines.Length
        Count = 0
        Errors = ""

        If (Times <= 0) Then
            Errors = Errors + "Times > 0" + Chr(13)
        End If

        If (Interval <= 0) Then
            Errors = Errors + "Interval > 0" + Chr(13)
        End If

        If (Lines <= 0) Then
            Errors = Errors + "There aren't Text to Write" + Chr(13)
        End If

        If (Errors = "") Then
            ReDim MessageArray(Lines)
            For i = 0 To Lines - 1
                MessageArray(i) = Me.txt_Message.Lines(i).ToString()
            Next

            While (Me.Send_Keys = True And Count < Times)
                For i = 0 To Lines - 1
                    If (Me.Send_Keys = True) Then
                        SendKeys.SendWait(MessageArray(i))
                        If (i < Lines - 1) Then
                            SendKeys.SendWait("{ENTER}")
                        End If
                        System.Threading.Thread.Sleep(Interval * 1000)
                    End If
                Next
                Count = Count + 1
            End While
            Me.Send_Keys = False
        Else
            MessageBox.Show(Errors)
        End If
        Me.tmr_Timer_1.Interval = 10
    End Sub
    '----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>----<>><>>
End Class