Click here to Skip to main content
15,915,094 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Which controls to use Pin
Abhishek Sur13-Dec-09 11:22
professionalAbhishek Sur13-Dec-09 11:22 
GeneralRe: Which controls to use Pin
Mycroft Holmes13-Dec-09 13:14
professionalMycroft Holmes13-Dec-09 13:14 
GeneralRe: Which controls to use Pin
Abhishek Sur13-Dec-09 21:53
professionalAbhishek Sur13-Dec-09 21:53 
GeneralRe: Which controls to use Pin
Mycroft Holmes13-Dec-09 22:38
professionalMycroft Holmes13-Dec-09 22:38 
QuestionLoading an Image from Database to ImageBox Pin
bharanidharanit12-Dec-09 10:34
bharanidharanit12-Dec-09 10:34 
AnswerRe: Loading an Image from Database to ImageBox Pin
Abhishek Sur13-Dec-09 11:18
professionalAbhishek Sur13-Dec-09 11:18 
AnswerRe: Loading an Image from Database to ImageBox Pin
Nerv1017-Dec-10 21:26
Nerv1017-Dec-10 21:26 
QuestionEncrypting & Decrypting a text Pin
bharanidharanit12-Dec-09 10:32
bharanidharanit12-Dec-09 10:32 
Hi used the below coding for enrypting and decrypting a text. But with this i dont know how to save to a database, when i tried i am getting many errors. How to do this?
Private Sub cmdEncrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
        ' Encrypt<br />
        MyText = Encrypt(textbox1.text, "aabc123a") ' Here aabc123a is the key and textbox1.text is the text which you want to encrypt<br />
    End Sub<br />
<br />
Private Function Encrypt(ByVal strText As String, ByVal strEncrKey As String) As String<br />
        Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}<br />
        Try<br />
            Dim bykey() As Byte = System.Text.Encoding.UTF8.GetBytes(strEncrKey)<br />
            Dim InputByteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(strText)<br />
            Dim des As New DESCryptoServiceProvider<br />
            Dim ms As New MemoryStream<br />
            Dim cs As New CryptoStream(ms, des.CreateEncryptor(bykey, IV), CryptoStreamMode.Write)<br />
            cs.Write(InputByteArray, 0, InputByteArray.Length)<br />
            cs.FlushFinalBlock()<br />
            Return Convert.ToBase64String(ms.ToArray())<br />
        Catch ex As Exception<br />
            Return ex.Message<br />
        End Try<br />
    End Function<br />
<br />
Private Sub cmdDecrypt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click<br />
        MyText = Decrypt(TextBox2.Text, "aabc123a")<br />
End Sub<br />
<br />
Private Function Decrypt(ByVal strText As String, ByVal sDecrKey As String) As String<br />
        Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}<br />
        Dim inputByteArray(strText.Length) As Byte<br />
        Try<br />
            Dim byKey() As Byte = System.Text.Encoding.UTF8.GetBytes(sDecrKey)<br />
            Dim des As New DESCryptoServiceProvider<br />
            inputByteArray = Convert.FromBase64String(strText)<br />
            Dim ms As New MemoryStream<br />
            Dim cs As New CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write)<br />
            cs.Write(inputByteArray, 0, inputByteArray.Length)<br />
            cs.FlushFinalBlock()<br />
            Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8<br />
            Return encoding.GetString(ms.ToArray())<br />
        Catch ex As Exception<br />
            Return ex.Message<br />
        End Try<br />
    End Function<br />
<br />
Remember to add top of import: Imports System.Security.Cryptography


IT Professional.
Work till you get it!

AnswerRe: Encrypting & Decrypting a text Pin
Abhishek Sur13-Dec-09 10:13
professionalAbhishek Sur13-Dec-09 10:13 
QuestionHow do i make the menu selected item have a different color? tabbed menu ASP.NET MVC Pin
basilmir12-Dec-09 7:51
basilmir12-Dec-09 7:51 
AnswerRe: How do i make the menu selected item have a different color? tabbed menu ASP.NET MVC Pin
m-khansari12-Dec-09 22:05
m-khansari12-Dec-09 22:05 
AnswerRe: How do i make the menu selected item have a different color? tabbed menu ASP.NET MVC Pin
Jim G6-Apr-10 15:13
Jim G6-Apr-10 15:13 
QuestionAzure and Web Controls Pin
#realJSOP12-Dec-09 4:15
professional#realJSOP12-Dec-09 4:15 
AnswerRe: Azure and Web Controls Pin
Oakman12-Dec-09 8:49
Oakman12-Dec-09 8:49 
AnswerRe: Azure and Web Controls Pin
Abhishek Sur12-Dec-09 9:57
professionalAbhishek Sur12-Dec-09 9:57 
QuestionPrinting in ASP.NET Pin
tunsten12-Dec-09 2:33
tunsten12-Dec-09 2:33 
AnswerRe: Printing in ASP.NET Pin
m-khansari12-Dec-09 3:40
m-khansari12-Dec-09 3:40 
GeneralRe: Printing in ASP.NET Pin
tunsten15-Dec-09 5:13
tunsten15-Dec-09 5:13 
GeneralRe: Printing in ASP.NET Pin
m-khansari15-Dec-09 23:02
m-khansari15-Dec-09 23:02 
QuestionGetting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:03
tunsten12-Dec-09 2:03 
AnswerRe: Getting Server control Id with JavaScript code... Pin
Abhijit Jana12-Dec-09 2:13
professionalAbhijit Jana12-Dec-09 2:13 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:25
tunsten12-Dec-09 2:25 
AnswerRe: Getting Server control Id with JavaScript code... Pin
Iman Ebadi12-Dec-09 2:45
Iman Ebadi12-Dec-09 2:45 
GeneralRe: Getting Server control Id with JavaScript code... Pin
tunsten12-Dec-09 2:58
tunsten12-Dec-09 2:58 
AnswerRe: Getting Server control Id with JavaScript code... Pin
Abhishek Sur12-Dec-09 10:02
professionalAbhishek Sur12-Dec-09 10:02 

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.