Click here to Skip to main content
15,358,266 members
Home / Discussions / C#
   

C#

 
Questionwebrowser control Pin
Member 1105956910-Sep-14 8:26
MemberMember 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
MemberMember 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
MemberMember 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
MemberMember 1105956913-Sep-14 23:36 
Questionadd code to build millisecond to testing progressbar in c# 2008 Pin
KaKoten9-Sep-14 18:40
MemberKaKoten9-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
professionalPIEBALDconsult9-Sep-14 19:45 
GeneralRe: add code to build millisecond to testing progressbar in c# 2008 Pin
KaKoten11-Sep-14 1:39
MemberKaKoten11-Sep-14 1:39 
AnswerRe: add code to build millisecond to testing progressbar in c# 2008 Pin
CPallini9-Sep-14 19:59
mveCPallini9-Sep-14 19:59 
GeneralRe: add code to build millisecond to testing progressbar in c# 2008 Pin
KaKoten11-Sep-14 1:39
MemberKaKoten11-Sep-14 1:39 
QuestionAny **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer019-Sep-14 18:16
MemberSledgeHammer019-Sep-14 18:16 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
PIEBALDconsult9-Sep-14 19:42
professionalPIEBALDconsult9-Sep-14 19:42 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer019-Sep-14 20:07
MemberSledgeHammer019-Sep-14 20:07 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
Pete O'Hanlon9-Sep-14 20:46
mvaPete O'Hanlon9-Sep-14 20:46 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer0110-Sep-14 6:46
MemberSledgeHammer0110-Sep-14 6:46 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
PIEBALDconsult10-Sep-14 3:14
professionalPIEBALDconsult10-Sep-14 3:14 
GeneralRe: Any **FAST** way to convert IEnumerable to IEnumerable<T>? Pin
SledgeHammer0110-Sep-14 6:42
MemberSledgeHammer0110-Sep-14 6:42 
Questionadd row to datagridview by checking child node check box of treeview Pin
Member 110597999-Sep-14 15:39
MemberMember 110597999-Sep-14 15:39 
AnswerRe: add row to datagridview by checking child node check box of treeview Pin
Member 1105979911-Sep-14 7:55
MemberMember 1105979911-Sep-14 7:55 
QuestionChat Application Pin
Kevin Marois9-Sep-14 11:23
professionalKevin Marois9-Sep-14 11:23 
AnswerRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 11:36
professionalRavi Bhavnani9-Sep-14 11:36 
GeneralRe: Chat Application Pin
Kevin Marois9-Sep-14 11:37
professionalKevin Marois9-Sep-14 11:37 
GeneralRe: Chat Application Pin
Ravi Bhavnani9-Sep-14 11:39
professionalRavi Bhavnani9-Sep-14 11: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.