Solved

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

Posted on 2008-06-10
1
5,825 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

757 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