Solved

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

Posted on 2008-06-10
1
5,936 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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

860 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