|
how can i protect my string:
provate string conn_string = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/" + "mydatabase.mdb" + ";Jet OLEDB:Database Password=mypassword;";
in this way everyone can get "mypassword"
so how can i protect it?
|
|
|
|
|
Not everyone, unless you put that in a publically available file. Then the solution would obviously be not to.
From whom do you need to protect it?
---
b { font-weight: normal; }
|
|
|
|
|
it is very easy to hacker a c# compiled source.
so it is very easy to get a password to get access at the database.
|
|
|
|
|
This How To shows you how to create a managed class library that exposes DPAPI functionality to applications that want to encrypt data, for example, database connection strings and account credentials.
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
You put your connection string in your configuration file and you encrypt it. You of course have to decrypt it to use it. Take a look at Microsoft's Enterprise Library in their "Patterns and Practices" stuff. The Enterprise Library includes "Application Blocks" for Encryption, Configuration, Database Access, Logging, Exceptions, and more I think. It's huge but there's a lot of good stuff in there if you choose to use it.
Also, there's a property (sorry I don't remember the name) on the Connection objects that directs it not to store sensitive info. This is only the password in Oracle's ODP.Net but I think SQL Server's Connection is supposed to drop the Id as well. I don't know about OLEDB.
Good luck.
|
|
|
|
|
What we would do is the following:
1) put the connection string in a config file
2) encapsulate getting the string from the config file
3) once you are successful in getting the read from db working in a test configuration, add an encryption module.
4) write a quick and dirty that encrypts any string and shows the result
5) use your encryption technique and encrypt the string
6) replace your connection string with the encrypted data
7) add the decryption in your encapsulated routine and verify you can still access the database
8) now place the encryption/decryption key in the registry and lock it down with security so that only your application has the rights to read it.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
8) now place the encryption/decryption key in the registry and lock it down with security so that only your application has the rights to read it.
what do you mean about registry, and "lock it down with security.."?
|
|
|
|
|
i am trying to add an ActiveX web browser control to a form during runtime.
i need to do this so that i can create instances of the control and add them to different tabs.
at present i get a 'InvalidActiveXStateException' trying to use the control.
heres my code
AxWebBrowser browser = new AxWebBrowser();
this.Controls.Add(browser);
browser.Dock = DockStyle.Fill;
browser.Navigate("http://www.google.com"); // this line cause the exception
i am guessing that its because the control need to be initialized before the form is created.
anyone got any ideas how to get around this?
|
|
|
|
|
Investigate how it's done if you were to do it through the designer. I believer there's an OcxState or similar propery that has to be initialized before you can add it to the control through code.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Little House on the Flickr
Judah Himango
|
|
|
|
|
thanx man, i looked around and found the code in the form1.designer.cs
heres my code if anyone else come across this problem.
this code adds an activex webbrowser control to a tabpage of a tabcontrol. You just pass it the tabpage by reference
<code>
private AxWebBrowser webPage = new AxWebBrowser();
private void AddBrowserToTab(ref TabPage tp)
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager();
((System.ComponentModel.ISupportInitialize)(webPage)).BeginInit();
tp.Controls.Add(webPage);
((System.ComponentModel.ISupportInitialize)(webPage)).EndInit();
}
</code>
|
|
|
|
|
I create a shortcut for my application in startup folder. But in some machines, after Windows start, it's also running but it can not load all .dll files it uses. So it's frozen. But after that, I terminate it from task manager and click the shortcut in Startup folder, it runs perfectly. And I also add it to registry in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key, but nothing is better. Do you have any ideas?
Thanks,
hvtin
|
|
|
|
|
Have you checked the event log for error messages?
---
b { font-weight: normal; }
|
|
|
|
|
There's no error. Maybe some Windows dll file which it uses, are loading, not finish. Because I tried to delay my application about 20s before it starts, it runs ok. Thanks!
hvtin
|
|
|
|
|
Hi all, there's a tool in VisualStudio/C# to see the senders and implementors of a method?
(All Smalltalks have this tool from almost 30 years)
Regards
|
|
|
|
|
Greetings,
I have been challenged with accessing an Act2000 dbf with a c# program for readonly access. The odbc doesn't work properly with any of the drivers I have been able to find. Act2000 isn't fully odbc compliant either. I found crystal reports uses the driver pdiract3.dll or p2iract3.dll to access the database. Is there a way to use the dll in a c# program to access the database directly like crystal does? Any help is greatly appreciated.
Cheers..
Mark
|
|
|
|
|
I wish to retrive that URL from my bookmark of either IE or Mozilla Firefox, how is it possible? And can I get the date/time that I last visit those sites?
|
|
|
|
|
Both browsers store bookmarks/favorites in files (I think mozilla uses xml, not shure dough).
Check out those files and find a way to parse the data.
But I doubt you will be able to get information about last access...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Got it thanks, another query to add ...
Instead of finding the XML file, I got the HTML file that has these information instead. It include the HREF as well as LAST_VISIT, one of which is LAST_VISIT="1136827040", what did the number stand for anyway? Is it date? I last open it on January 19, 2006 though.
|
|
|
|
|
I supose that is a UNIX timestamp...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
For IE in order to get the html file I need to manually export the file, do you know how to export it using c# coding?
|
|
|
|
|
Hi all.
To ease the code writing of a propietary language I want to build a Visual Studio 2003 add-in that colors the syntax, provides auto-completion capabilities, etc. I am new to this VS automation stuff and I have googling a lot but still haven't found anything about changing the attributes of certain characters of a text editor. Does anybody has any ideas of how can I do this? Furthermore, how can I handle key press events without using the VS 2005's EnvDTE80 assembly?
Thanks beforehand.
The traveller
|
|
|
|
|
Hello World,
I just would like to open a dialog window asking me if I really want to delete the contact i chose when I'm trying to delete a contact. If you don't know how in c#. Thank you very much!!
-- modified at 14:30 Wednesday 18th January, 2006
|
|
|
|
|
if (DialogResult.OK == MessageBox.Show("Do you really want to delete ?", "Delete confirmation", MessageBoxButtons.OKCancel)
{
// do it here
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi.
As you know I'm not so very good at programming but I like it very much.
To the question. I want to know how to be able to unable a keyboard button. I want it so if you press the enter button absolutely nothing happens? don't laugh att me because I can't a simple thing at this but as I said I'm a big amatuer.
Any help and maybe some tutorials would be nice?
Thank you very much,
Simon an amateur in c# programming.
|
|
|
|
|
If you want this within your app, you can handle the keypress event and sent e.Handled to true when enter is pressed. For a system wide approach you need a keyboard hook.
Christian Graus - Microsoft MVP - C++
|
|
|
|