473,788 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ConvertToSecure String (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.Ap pendChar(c);
}

return secureString;
}

Thanks,
-tom
Apr 2 '08 #1
1 1301
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
"thomasnguyenco m" 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 ConvertToSecure String (string str)
{
SecureString secureString = new SecureString();
foreach (char c in str)
{
secureString.Ap pendChar(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
2257
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 sure that the Category ItemTemplate is there and that it is previouly populated. Am I missing something? Here's the code: private void Page_Load(object sender, System.EventArgs e) {
2
19048
by: David Dvali | last post by:
How can I cut/copy/paste text from/into textbox using clipboard from my code?
4
16681
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
2961
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 requires an object reference". Being new to VB.NET, this doesn't say much to me, nor does the Show Task Help for this particular msg. Just one example would make all the difference in the world. Can somebody point me in the right direction?? ...
2
1411
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 side value but I need to do it in the HTML and not the code behind. Has to do with custom javascript events and what not. In 1.1 I have this and it works fine:
5
2368
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 is less than a week. I've gone through what appear to be the relevant tutorials that came with the product, consulted the two reference books I have, explored the source code that is being generated by my project, and played around trying...
2
1548
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
2662
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"); mytextbox.focus(); mytextbox.scrolltocaret();
3
1177
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
3927
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) but some things VB.NET does not recognize them (for example, some "imports"). I do not also know use the part of the code that begins for " <Page ... ", though VB.NET admits this code if in front of every line write three characters of commentary (...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.