|
|
Hello,
I would like to store the encrypted password in the Windows Registry, and in my application I want to retrieve the password and decrypt it for further use. How can I achieve this.
Thank you.
|
|
|
|
|
Look at the Microsoft.Win32 namespace for registry writing.
Look at the System.Security.Cryptography namespace for encrypting and decrypting data.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
I can access Windows Registry no problem. The problem is, I don't know how to store encrypted password in the registry, and when I want to retrieve the password, I need to decrypt the password as well. I figured that I have to use the Cryptograph class, but in what way to encrypt and decrypt the information I can figure out.
Thank you.
|
|
|
|
|
|
zaboboa wrote: I would like to store the encrypted password in the Windows Registry, and in my application I want to retrieve the password and decrypt it for further use.
So where do you want to store the encryption key in order to decrypt it?
If this is a user password that the user must type in to gain access to something, then using a hashing algorithm is a much better idea. Hashing is a type of one way encryption (you can encrypt, but you cannot decrypt). So when the user types in their password it is also hashed and the two hash values are compared. The bonus is that you don't need to figure out where to store any keys in order to decrypt the data (because you can't decrypt the data)
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I would like to store the password in the windows registry, and I want to use the password to access the SQL Server from my Application. So, user will never type in the password. The application will use a generic account to access SQL server and not per user basis. And I want to store the password in the windows registry.
Thank you.
|
|
|
|
|
hi!
i have written an application with a mask to enter some text and calculate something. this data is save in a file and now i want to print this file, out of my application.
can someone tell me a good way to do this or some tips how i have to write the printsetup?
thx
greatings dominik
|
|
|
|
|
|
In a form class module (Formtest) this is what I am doing in .NET 2.0:
AppBar.CCInfo.CanApprove
In AppBa there is a struct
the compiler is giving an error as follows:
Accessing a member on 'ChngCtrlUI.frmAppBar.CCInfo' may cause a runtime exception because it is a field of a marshal-by-reference class
Thanks
|
|
|
|
|
Try wrapping frmAppBar as a public property, making the field private.
Or, make ChngCtrlUI not inherit from MarshalByRefObject if you don't need remoting.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
I'm brand new to C# and I'm trying to figure out how to parse a string. Is there a function available much like the explode() function in PHP which breaks up the string on a certain character and places the different parts into an array?
|
|
|
|
|
string s = "a,b,c";
string[] parsed = s.Split(',');
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Well, one thing I'm doing is this. I have a String variable called 'filename' which contains the entire path and filename, including extension. I want just the filename, no directories or extensions. To do this, I have this one command:
String shortened = Filename.Substring(Filename.LastIndexOf("\\") + 1, Filename.LastIndexOf(".") - Filename.LastIndexOf("\\") - 1);
LastIndexOf() figures out the number position of the last one of that kind of character.
Substring() extracts out n number of characters starting at position m, where the arguments are .Substring(m, n)
C# isn't meant to parse out strings like PHP, PERL and others but I think you can find quite suitable alternatives using those methods and possibly others.
|
|
|
|
|
I'm using .Net 2.0 and for the life of me, I can't find the "Always Show Selection" attribute on ListViews. Did they remove it? Right now, the selection is only showing witht the list control has focus.
Can someone please point me to where they hid it?
thanks
|
|
|
|
|
|
Lol! They should publish a list of all this little changes like that to keep us old timers from looking like idiots.
Thanks Joel.
|
|
|
|
|
Hi all
how can i change the color of the titlebar without affecting windows settings and add only the minimize button to it
thx
|
|
|
|
|
|
I am using C#.NET Framework 1.1 and i made a windows service which is running in background. This service opened a socket (Listener) on a specified port at startup. Client connected to this port and send a message to listener and close the socket again client connect after some time maybe after 5 minutes or above and send another message to listener and close the socket. (Socket is Accpeted, Send & Receive data Asynchronously)
This service work fine for a period of time. But after that
Question: Socket does not accept new connection while socket is in listening state.
Whenever i want to connect to this socket (either by Telnet or by my client on lan or wan or even by local-loop) the exception is occured.
Error Code: WSAECONNREFUSED 10061
Description: No connection could be made because the target computer actively refused it.
After restart the service, socket works fine again for some period of time.
Is there any solution.
Thanks in advance
Zeeshan
|
|
|
|
|
I think you misuse the socket. Do you have sample code?
Basically, the Socket.Accept() method returns a new Socket object. You must use this object to talk to the client, usually on another thread, so the server socket can return into accepting a new client request.
Also, when programming with sockets, you must be careful that the Socket returned by Accept is disposed of [Socke.Disconnect()]. That is probably where your problem is: you ignore the returned socket and use the server one to talk to the client, hence not disposing of the returned socket, which makes your server run out of connections.
Post the code, and I will probably be able to help you out.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
-- modified at 9:57 Tuesday 24th January, 2006
|
|
|
|
|
When I use the following code with the EnableSsl line commented out, all is well. Otherwise I get this error: The message or signature supplied for verification has been altered.
FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(myUrl);
ftpRequest.Credentials = myCredentials;
ftpRequest.EnableSsl = true;
ftpRequest.Method = WebRequestMethods.Ftp.ListDirectory;
using (FtpWebResponse ftpResponse = (FtpWebResponse)ftpRequest.GetResponse())
Does anyone have any experience using the FTP objects with SSL?
Thanks!
|
|
|
|
|
Is it possible to use the configurationManager is a windows form in .net 2.0 or is it just for ASP.NET 2.0 ?
Thanks
|
|
|
|
|
fmardani wrote: Is it possible to use the configurationManager is a windows form in .net 2.0
Yes.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Dear all,
I am using C# to alter a DBF file , Foxpro driver downloaded ,Everything working fine but after running alter query whole DBF format gets corrupted. And I am not able to open it again.
I am adding the code snippet below.Do help me in this regard
public void Alter_table()
{
try
{
string strConnect;
strConnect="User ID=;DSN=;Collating Sequence=MACHINE;Data Source='d:\\22.dbf';Provider=VFPOLEDB.1;Cache Authentication=False;Mask Password=False;persist security info=False;Mode=Share Exclusive;Extended Properties=;Encrypt Password=False";
OleDbConnection dconn=new OleDbConnection();
dconn.ConnectionString = strConnect;
dconn.Open();
OleDbCommand mycmd=new OleDbCommand();
OleDbCommand myCmd = new OleDbCommand("ALTER TABLE 22.dbf ADD COLUMN TEST1 c(10) NULL", dconn);
myCmd.ExecuteNonQuery();
}
catch(OleDbException ex)
{
MessageBox.Show(ex.Message);
}
}
Thanks for any kind of help
hi it is rudara
|
|
|
|