Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
QuestionHow to scroll ListView from your source code? Pin
Chesnokov Yuriy7-Dec-10 2:50
professionalChesnokov Yuriy7-Dec-10 2:50 
AnswerRe: How to scroll ListView from your source code? Pin
Luc Pattyn7-Dec-10 3:26
sitebuilderLuc Pattyn7-Dec-10 3:26 
AnswerRe: How to scroll ListView from your source code? Pin
Chesnokov Yuriy7-Dec-10 19:47
professionalChesnokov Yuriy7-Dec-10 19:47 
AnswerRe: How to scroll ListView from your source code? Pin
Luc Pattyn7-Dec-10 22:53
sitebuilderLuc Pattyn7-Dec-10 22:53 
AnswerRe: How to scroll ListView from your source code? Pin
#realJSOP7-Dec-10 23:30
professional#realJSOP7-Dec-10 23:30 
QuestionLogon Failed Error For Crystal Report. Pin
Sanket.Patil7-Dec-10 1:28
Sanket.Patil7-Dec-10 1:28 
AnswerRe: Logon Failed Error For Crystal Report. Pin
Alok Sharma ji7-Dec-10 1:51
Alok Sharma ji7-Dec-10 1:51 
GeneralRe: Logon Failed Error For Crystal Report. Pin
Sanket.Patil7-Dec-10 18:04
Sanket.Patil7-Dec-10 18:04 
GeneralRe: Logon Failed Error For Crystal Report. Pin
Alok Sharma ji8-Dec-10 0:45
Alok Sharma ji8-Dec-10 0:45 
GeneralRe: Logon Failed Error For Crystal Report. Pin
Sanket.Patil8-Dec-10 0:55
Sanket.Patil8-Dec-10 0:55 
AnswerRe: Logon Failed Error For Crystal Report. Pin
thatraja8-Dec-10 1:48
professionalthatraja8-Dec-10 1:48 
Question10 digit Crypted Value Pin
Enobong Adahada6-Dec-10 22:48
Enobong Adahada6-Dec-10 22:48 
AnswerRe: 10 digit Crypted Value Pin
OriginalGriff7-Dec-10 0:40
mveOriginalGriff7-Dec-10 0:40 
GeneralRe: 10 digit Crypted Value Pin
Enobong Adahada7-Dec-10 0:59
Enobong Adahada7-Dec-10 0:59 
GeneralRe: 10 digit Crypted Value Pin
OriginalGriff7-Dec-10 1:09
mveOriginalGriff7-Dec-10 1:09 
AnswerRe: 10 digit Crypted Value Pin
Yvan Rodrigues12-Dec-10 13:59
professionalYvan Rodrigues12-Dec-10 13:59 
AnswerRe: 10 digit Crypted Value Pin
Sathesh Sakthivel7-Dec-10 0:52
Sathesh Sakthivel7-Dec-10 0:52 
GeneralRe: 10 digit Crypted Value Pin
Enobong Adahada7-Dec-10 1:03
Enobong Adahada7-Dec-10 1:03 
here is my code:

public static string iEncrypt(string plainText, string passPhrase, string saltValue,
string HashAlgorithm, int passwordIterations, string initVector,
int KeySizes)
{
byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);
byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, saltValueBytes, HashAlgorithm, passwordIterations);
byte[] keyBytes = password.GetBytes(KeySizes / 8);
RijndaelManaged symmetricaKey = new RijndaelManaged();
symmetricaKey.Mode = CipherMode.CBC;
ICryptoTransform encryptor = symmetricaKey.CreateEncryptor(keyBytes, initVectorBytes);
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write);
cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
cryptoStream.FlushFinalBlock();
byte[] cipherTextBytes = memoryStream.ToArray();
memoryStream.Close();
cryptoStream.Close();
string cipherText = Convert.ToBase64String(cipherTextBytes);
return cipherText;
}




static void Main(string[] args)
{
//string plainText="Hello World!";
string plainText;
string passPhrase = "Pas5pr@se";
//string passPhrase = "123456789";
//string saltValue = "123456789";//s@ltValue";
string saltValue = "s@ltValue";
string hashAlgorithm = "SHA1";
int passwordIterations = 1;
//string initVector = "abcdefghijklmnop";//@1B2c3D4e5F6g7H8";
string initVector = "@1B2c3D4e5F6g7H8";
int keySize = 64;//256;
//Console.WriteLine(string.Format("Plaintext : {0}", plainText));
Console.WriteLine(string.Format("Type Plaintext : "));
plainText= Console.ReadLine();
string cipherText = dEncrypt.iEncrypt(plainText, passPhrase, saltValue, hashAlgorithm, passwordIterations, initVector, keySize);
Console.WriteLine(string.Format("Encrypted : {0}", cipherText));

}
GeneralRe: 10 digit Crypted Value Pin
Not Active7-Dec-10 2:16
mentorNot Active7-Dec-10 2:16 
QuestionASP C# WebSite to load a simple CSV File Pin
gorovdude6-Dec-10 21:54
gorovdude6-Dec-10 21:54 
AnswerRe: ASP C# WebSite to load a simple CSV File [modified] Pin
Dan Mos6-Dec-10 22:17
Dan Mos6-Dec-10 22:17 
QuestionRe: ASP C# WebSite to load a simple CSV File Pin
Luc Pattyn6-Dec-10 22:26
sitebuilderLuc Pattyn6-Dec-10 22:26 
AnswerRe: ASP C# WebSite to load a simple CSV File Pin
Dan Mos6-Dec-10 22:27
Dan Mos6-Dec-10 22:27 
GeneralRe: ASP C# WebSite to load a simple CSV File Pin
Luc Pattyn6-Dec-10 22:30
sitebuilderLuc Pattyn6-Dec-10 22:30 
GeneralRe: ASP C# WebSite to load a simple CSV File Pin
Dan Mos6-Dec-10 22:31
Dan Mos6-Dec-10 22:31 

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.