Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Windows Forms » Downloads
 
Add your own
alternative version

Encryption and Decryption

, 24 Mar 2009 CPOL
Its the software who can make the Ceasares Code
CESAR1.zip
CESAR1
CESAR1
bin
Debug
CESAR1.exe
CESAR1.pdb
CESAR1.vshost.exe
CESAR1.vshost.exe.manifest
obj
Debug
CESAR1.csproj.GenerateResource.Cache
CESAR1.exe
CESAR1.Form1.resources
CESAR1.Opcionet.resources
CESAR1.Opcionet1.resources
CESAR1.pdb
CESAR1.Properties.Resources.resources
CESAR1.Rreth.resources
CESAR1.Startup.resources
Programi per Enkriptim dhe Dekriptim.csproj.GenerateResource.Cache
Refactor
TempPE
Properties.Resources.Designer.cs.dll
Programi per Enkriptim dhe Dekriptim.csproj.user
Properties
Settings.settings
Resources
1.jpg
2.jpg
4.jpg
a.jpg
CESAR1.suo
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CESAR1
{
    public partial class Opcionet1 : Form
    {
        public Opcionet1()
        {
            InitializeComponent();
        }
        Enkripto_Dekripto objEnkDek = new Enkripto_Dekripto();
        public void btnZhvendos_Click()
        {

            if (txtAlfabeti.Text.Length != 0)
            {
                txtAlfCesari.Clear();
                int Total = txtAlfabeti.Text.Length;
                char[] c;
                int p;
                int Celesi = Convert.ToInt16(txtCelesiOpcionet.Text);
                c = txtAlfabeti.Text.ToCharArray(0, Total);


                for (int i = 0; i < Total; i++)
                {
                    if (c[i] > 64 && c[i] < 91)
                    {
                        objEnkDek.k = objEnkDek.k + 1;
                        p = (char)c[i];
                        p = p - 65;
                        if ((Celesi >= 0) && (Celesi <= 26))
                        {
                            objEnkDek.CelesiMemorik = Celesi;
                            p = p + Celesi;
                            p = p % 26;
                            p = p + 65;
                            c[i] = (char)p;
                        }
                        else
                        {
                            MessageBox.Show("Celesi duhet te jete numer pozitiv mbrenda 0-26");
                            txtCelesiOpcionet.Text = "0";
                            Celesi = 0;
                        }
                    }
                    else if (c[i] > 96 && c[i] < 123)
                    {
                        objEnkDek.k = objEnkDek.k + 1;
                        p = (char)c[i];
                        p = p - 97;
                        if ((Celesi >= 0) && (Celesi <= 26))
                        {
                            p = p + Celesi;
                            p = p % 26;
                            p = p + 97;
                            c[i] = (char)p;
                        }
                        else
                        {
                            MessageBox.Show("Celesi duhet te jete numer pozitiv mbrenda 0-26");
                            txtCelesiOpcionet.Text = "0";
                            Celesi = 0;
                        }
                    }

                    txtAlfCesari.AppendText(c[i].ToString());
                }
            }
            else
            {
                MessageBox.Show("Ju lutem Mbushni Text per te Enkriptuar");
            }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

dj_limi
Team Leader
Albania Albania
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141220.1 | Last Updated 24 Mar 2009
Article Copyright 2009 by dj_limi
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid