Solved

how to assign a password as system.security.secureString  VB.NET 2.0

Posted on 2008-06-10
1
5,886 Views
Last Modified: 2013-11-26
I want to open a file using a password with process start.  The password is "pass+word".  How can I convert the password to type system.security.secure string?


Dim sFile = "\\server\servdir\somefile.pdf"

Dim sUser As String = "user"

Dim sPass As String = "pass+word"

Dim SDomain As String = "XYZ"
 

'newPass = New System.Security.SecureString() ???????

 

Process.Start(sFile, sUser, newPass, SDomain)

Open in new window

0
Comment
Question by:stevep01
1 Comment
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 250 total points
ID: 21752664
I haven't worked with secure string, but maybe try this:

Dim newPass as New Security.SecureString()

For Each c As Char In sPass

    newPass.AppendChar(c)

Next c

Open in new window

1

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Different Delete Messages 7 37
Server Error 11 47
Run time Error 4 34
Where to download and how to install sqldmo.dll 5 33
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now