How to convert string to SecureString?

Discussion in 'ASP .Net Security' started by Bishoy George, Aug 23, 2006.

  1. I want to pass a string password in System.Diagnostics.Process.Start.

    The problem is that the defined password parameter is SecureString not
    string while my password is string.

    Normal casting evaluates to errors.

    Please how to cast string to SecureString?

    Many Thanks in Advance.

    Bishoy
    Bishoy George, Aug 23, 2006
    #1
    1. Advertising

  2. "Bishoy George" <> wrote in message
    news:...
    > I want to pass a string password in System.Diagnostics.Process.Start.
    >
    > The problem is that the defined password parameter is SecureString
    > not string while my password is string.
    >
    > Normal casting evaluates to errors.
    >
    > Please how to cast string to SecureString?
    >
    > Many Thanks in Advance.
    >
    > Bishoy
    >
    >
    >

    -------------------------------------

    I found a simple way:

    char[] passwordChars = passwordPre.ToCharArray();

    SecureString password = new SecureString();

    foreach (char c in passwordChars)

    {

    password.AppendChar(c);

    }
    Bishoy George, Aug 23, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Banks

    Convert string to a string array

    Andrew Banks, Apr 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    57,980
    Andrew Banks
    Apr 19, 2004
  2. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    Connection String object Convert to String Variable Type

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Oct 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,060
    Norman Yuan
    Oct 26, 2004
  3. Replies:
    1
    Views:
    324
    Patrick.O.Ige
    Nov 9, 2005
  4. RMT

    Pass SecureString to web service?

    RMT, Jun 6, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    211
  5. Replies:
    2
    Views:
    177
    John Bokma
    Aug 30, 2013
Loading...

Share This Page