Click here to Skip to main content
15,904,935 members
Home / Discussions / C#
   

C#

 
QuestionRe: TX TextControl 21.0 Document viewer example in c# Pin
ZurdoDev11-Sep-14 4:27
professionalZurdoDev11-Sep-14 4:27 
AnswerRe: TX TextControl 21.0 Document viewer example in c# Pin
Dave Kreskowiak11-Sep-14 4:38
mveDave Kreskowiak11-Sep-14 4:38 
GeneralRe: TX TextControl 21.0 Document viewer example in c# Pin
PIEBALDconsult12-Sep-14 5:34
mvePIEBALDconsult12-Sep-14 5:34 
GeneralRe: TX TextControl 21.0 Document viewer example in c# Pin
Dave Kreskowiak12-Sep-14 5:39
mveDave Kreskowiak12-Sep-14 5:39 
QuestionHow to loop in timers Pin
Member 1107411510-Sep-14 21:02
Member 1107411510-Sep-14 21:02 
AnswerRe: How to loop in timers Pin
OriginalGriff10-Sep-14 21:52
mveOriginalGriff10-Sep-14 21:52 
GeneralRe: How to loop in timers Pin
Member 1107411510-Sep-14 22:02
Member 1107411510-Sep-14 22:02 
GeneralRe: How to loop in timers Pin
OriginalGriff10-Sep-14 22:09
mveOriginalGriff10-Sep-14 22:09 
GeneralRe: How to loop in timers Pin
Member 1107411510-Sep-14 22:41
Member 1107411510-Sep-14 22:41 
GeneralRe: How to loop in timers Pin
OriginalGriff10-Sep-14 22:57
mveOriginalGriff10-Sep-14 22:57 
GeneralRe: How to loop in timers Pin
Member 1107411524-Sep-14 19:56
Member 1107411524-Sep-14 19:56 
QuestionThreading issue Pin
SledgeHammer0110-Sep-14 10:23
SledgeHammer0110-Sep-14 10:23 
AnswerRe: Threading issue Pin
PIEBALDconsult10-Sep-14 11:29
mvePIEBALDconsult10-Sep-14 11:29 
GeneralRe: Threading issue Pin
SledgeHammer0110-Sep-14 12:14
SledgeHammer0110-Sep-14 12:14 
GeneralRe: Threading issue Pin
PIEBALDconsult10-Sep-14 15:18
mvePIEBALDconsult10-Sep-14 15:18 
Questionwebrowser control Pin
Member 1105956910-Sep-14 8:26
Member 1105956910-Sep-14 8:26 
AnswerRe: webrowser control Pin
Eddy Vluggen10-Sep-14 8:29
professionalEddy Vluggen10-Sep-14 8:29 
Generalwebrowser control Pin
Member 1105956910-Sep-14 8:42
Member 1105956910-Sep-14 8:42 
GeneralRe: webrowser control Pin
Eddy Vluggen10-Sep-14 9:57
professionalEddy Vluggen10-Sep-14 9:57 
GeneralRe: webrowser control Pin
Member 1105956912-Sep-14 9:50
Member 1105956912-Sep-14 9:50 
GeneralRe: webrowser control Pin
Eddy Vluggen12-Sep-14 11:00
professionalEddy Vluggen12-Sep-14 11:00 
GeneralRe: webrowser control Pin
Member 1105956913-Sep-14 23:36
Member 1105956913-Sep-14 23:36 
Questionadd code to build millisecond to testing progressbar in c# 2008 Pin
KaKoten9-Sep-14 18:40
KaKoten9-Sep-14 18:40 
I'am trouble to implement encryption testing without times in millisecond and how i adding to the code??


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace RSAEncryption
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        #region-----Encryptionand Decryption Function-----
        static public byte[] Encryption(byte[] Data, RSAParameters RSAKey, bool DoOAEPPadding)
        {
            try
            {
                byte[] encryptedData;
                using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
                {
                    RSA.ImportParameters(RSAKey);
                    encryptedData = RSA.Encrypt(Data, DoOAEPPadding);
                }
                return encryptedData;
            }
            catch (CryptographicException e)
            {
                Console.WriteLine(e.Message);

                return null;
            }

        }

        static public byte[] Decryption(byte[] Data, RSAParameters RSAKey, bool DoOAEPPadding)
        {
            try
            {
                byte[] decryptedData;
                using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
                {
                    RSA.ImportParameters(RSAKey);
                    decryptedData = RSA.Decrypt(Data, DoOAEPPadding);
                }
                return decryptedData;
            }
            catch (CryptographicException e)
            {
                Console.WriteLine(e.ToString());

                return null;
            }

        }
        #endregion

        #region--variables area
        UnicodeEncoding ByteConverter = new UnicodeEncoding();
        RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
        byte[] plaintext;
        byte[] encryptedtext;
        #endregion

        #region-- Function Implemantation
        private void Encrypt_Click(object sender, EventArgs e)
        {
            plaintext = ByteConverter.GetBytes(txtplain.Text);
            encryptedtext = Encryption(plaintext, RSA.ExportParameters(false), false);
            txtencrypt.Text = ByteConverter.GetString(encryptedtext);
           
        }
        private void Decrypt_Click(object sender, EventArgs e)
        {
            byte[] decryptedtex = Decryption(encryptedtext, RSA.ExportParameters(true), false);
            txtdecrypt.Text = ByteConverter.GetString(decryptedtex);
        }
        #endregion
    }
}

AnswerRe: add code to build millisecond to testing progressbar in c# 2008 Pin
PIEBALDconsult9-Sep-14 19:45
mvePIEBALDconsult9-Sep-14 19:45 
GeneralRe: add code to build millisecond to testing progressbar in c# 2008 Pin
KaKoten11-Sep-14 1:39
KaKoten11-Sep-14 1:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.