Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
GeneralRe: Tristate Checkbox Pin
mav.northwind12-May-05 22:58
mav.northwind12-May-05 22:58 
QuestionHow to convert C# Application exe to C# code again? Pin
pubududilena12-May-05 17:12
pubududilena12-May-05 17:12 
AnswerRe: How to convert C# Application exe to C# code again? Pin
Judah Gabriel Himango12-May-05 18:45
sponsorJudah Gabriel Himango12-May-05 18:45 
GeneralRe: How to convert C# Application exe to C# code again? Pin
Priyank Bolia13-May-05 2:37
Priyank Bolia13-May-05 2:37 
GeneralRe: How to convert C# Application exe to C# code again? Pin
Dave Kreskowiak13-May-05 2:52
mveDave Kreskowiak13-May-05 2:52 
Questionhow to encode string in serialization Pin
Green Fuze12-May-05 14:36
Green Fuze12-May-05 14:36 
AnswerRe: how to encode string in serialization Pin
Stefan Prodan12-May-05 20:11
Stefan Prodan12-May-05 20:11 
AnswerRe: how to encode string in serialization Pin
StealthyMark13-May-05 4:38
StealthyMark13-May-05 4:38 
I'm assuming you want to serialize your class with the XmlSerializer. The simplest trick is to mark your cleartext Password field/property with XMLIgnore and add another property providing an encrypted password.
using System;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Security.Cryptography;
 
[Serializable]
public class UserData
{
    [XmlIgnore]
    public string Password;
 
    [XmlElement("Password", DataType = "base64Binary")]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public byte[] EncryptedPassword
    {
        get
        {
            // use the classes in the System.Cryptography
            // namespace to return the encrypted password
            return YourEncryptMethod(Password);
        }
        set
        {
            // use the classes in the System.Cryptography
            // namespace to decrypt the encrypted password
            Password = YourDecryptMethod(value);
        }
    }
}

Another possibility is to implement the IXmlSerializable interface and serialize your class manually.

HTH, Mark
GeneralInterop question C# Pin
IsaacB12-May-05 12:58
IsaacB12-May-05 12:58 
GeneralRe: Interop question C# Pin
pubududilena12-May-05 17:10
pubududilena12-May-05 17:10 
GeneralRe: Interop question C# Pin
StealthyMark13-May-05 5:18
StealthyMark13-May-05 5:18 
QuestionApplication always on top? Pin
Anthony Mushrow12-May-05 12:32
professionalAnthony Mushrow12-May-05 12:32 
AnswerRe: Application always on top? Pin
Dave Kreskowiak12-May-05 14:25
mveDave Kreskowiak12-May-05 14:25 
GeneralRe: Application always on top? Pin
cjengler13-May-05 0:00
cjengler13-May-05 0:00 
GeneralRe: Application always on top? Pin
Dave Kreskowiak13-May-05 0:57
mveDave Kreskowiak13-May-05 0:57 
GeneralRe: Application always on top? Pin
Sebastian Schneider13-May-05 1:30
Sebastian Schneider13-May-05 1:30 
GeneralRe: Application always on top? Pin
Dave Kreskowiak13-May-05 2:50
mveDave Kreskowiak13-May-05 2:50 
GeneralWindows XP Icons Pin
Peter Vertes12-May-05 12:18
Peter Vertes12-May-05 12:18 
GeneralRe: Windows XP Icons Pin
Dave Kreskowiak12-May-05 14:22
mveDave Kreskowiak12-May-05 14:22 
GeneralRe: Windows XP Icons Pin
Polis Pilavas13-May-05 0:12
Polis Pilavas13-May-05 0:12 
GeneralC# to extract Pin
ziczaczoom200412-May-05 12:09
ziczaczoom200412-May-05 12:09 
GeneralRe: C# to extract Pin
Stefan Prodan12-May-05 12:15
Stefan Prodan12-May-05 12:15 
GeneralRe: C# to extract Pin
ziczaczoom200412-May-05 13:09
ziczaczoom200412-May-05 13:09 
GeneralRe: C# to extract Pin
Dave Kreskowiak12-May-05 14:17
mveDave Kreskowiak12-May-05 14:17 
GeneralRe: C# to extract Pin
ziczaczoom200413-May-05 9:58
ziczaczoom200413-May-05 9:58 

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.