473,226 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

From a myTextBox.Text to a mySecureString.

What's the best way to handle this situation securely?

I'm currently manually converting the string to a SecureString, but
for some reason it looks ugly.

public SecureString ConvertToSecureString (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.AppendChar(c);
}

return secureString;
}

Thanks,
-tom
Apr 2 '08 #1
1 1288
AppendChar, InsertAt, and RemoveAt are the only methods available.
So, it may be ugly but that's the deal, essentially.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"thomasnguyencom" wrote:
What's the best way to handle this situation securely?

I'm currently manually converting the string to a SecureString, but
for some reason it looks ugly.

public SecureString ConvertToSecureString (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.AppendChar(c);
}

return secureString;
}

Thanks,
-tom
Apr 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Juba | last post by:
Hello, I have the following code placed at my Page_Load event and after the Datagrid is binded, so it is not empty. The problem is that the variable isclass is always returning null and I am...
2
by: David Dvali | last post by:
How can I cut/copy/paste text from/into textbox using clipboard from my code?
4
by: le_mo_mo | last post by:
Hi, How do you remove the CRLF from a multiline textbox entry? Does anybody have an example? Thanks, MO
4
by: Ken Soenen | last post by:
The code below illustrates my problem which is: I'm trying to access the TEXT from TextBox1 which is on Form1. Line "aa = Form1.TextBox1.Text" produces the error--Reference to a non-shared member...
2
by: Michael Raczynski | last post by:
Hey guys, Apologies if this is in the wrong thread, whenever I search for <% or "switching context" I get no results. What I am trying to do is set the value of a html text box to a server...
5
by: nomail.thanks | last post by:
I apologize for the question in advance. I have lots of experience with lots of other languages, but now I'm trying to accomplish something with VB.NET Express. My experience with VB.NET express...
2
by: Bruno Alexandre | last post by:
Hi guys... How can we get the object value from Javascipt... if I try: document.getElementById('myTextbox').value for <asp:textbox runat="server" id="myTextbox" text="blablabla" />
5
by: sherifffruitfly | last post by:
Hi, I want to derive of of TextBox, and add on an auto-scroll-to-bottom boolean property. I can use a regular textbox (rich or otherwise) and get the effect by: mytextbox.append("my text");...
3
by: =?Utf-8?B?S3VsYmVy?= | last post by:
Hello. Do you know how to convert this code to VB.NET? Thank you. http://msdn.microsoft.com/es-es/library/bb613590.aspx
5
by: =?Utf-8?B?S3VsYmVy?= | last post by:
I feel my delay. I had work. First of all, thank you for reply. I explain: I do not know use the code of the original web page in VB.NET. Gillard made the translation from C (and thank you)...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.