|
What are you saving your settings in the registry for? It seems odd to me that you are saving them, but not reading them.
Start->Run->"regedit"->OK
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I am saving Database settings but when I rerun the application I want to check if the database settings are there and if not than I am trying to direct to the database settings form.....
sasa
|
|
|
|
|
using Microsoft.Win32;
...
private bool GetRegValues(string cregPath)
{
RegistryKey rkeyMachine = Registry.LocalMachine;
RegistryKey rkeySub = rkeyMachine.OpenSubKey(cregPath, RegistryKeyPermissionCheck.ReadSubTree);
if (rkeySub == null)
{
MessageBox.Show("The registry key " + cregPath + " could not be opened.", "Registry Problem");
return false;
}
else
{
string cValue = "";
try
{
foreach (string cvalueName in rkeySub.GetValueNames())
{
cValue = rkeySub.GetValue(cvalueName).ToString();
<code>
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error");
return false;
}
finally
{
if (rkeySub != null)
rkeySub.Close();
}
}
return true;
}
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thank you for your help. I decided to use if((string)regkey.GetValue("Source")== null)
Appreciate your response.
sasa
|
|
|
|
|
Anybody know what the hell the point of this is? I hate to rant, but I'm getting just a BIT tired of NUnit not finding my config file, even though it's called DllFileName.dll.config. Turns out that the config file isn't being copied to some directory called the ShadowCopyCache. Any idea what this is, and how to turn it off?
Thanks all.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
Haven't dealt with that...for my server app with config file, my server unit test project just has a config file of its own copying the server's. Seems to work fine.
|
|
|
|
|
Yeah, it did for me up until today, too. It's weird. I've verified that my config file is named properly. It's just not getting copied to this so called ShadowCopyCache folder, and it's throwing NUnit off...
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
OK, figured out my problem. I needed to be using Assembly.GetExecutingAssembly().CodeBase, not Assembly.GetExecutingAssembly().Location for what I was doing in my code. The former returns the dll location, regardless of whether it was shadow copied or not. The latter returns the literal execution path.
Still, I'd love to find a way to turn that shadow feature of NUnit/.NET (not sure which) off.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
I have written a C# console application that copies files from an Windows 2000 server to a different Windows 2000 Server. I have a program that will convert the .bmp to .tif but I do not know how to call it from my C# Appliation. My Mentor was hired away to another company so my resource has dried up.
Thanks for all the help.
Bruce
|
|
|
|
|
Look up MSDN for the System.Diagnostics.Process class - That will give you the pointers that you need.
|
|
|
|
|
Try:
System.Diagnostics.Process.Start(@"C:\MyFile.txt");
Vasildb
|
|
|
|
|
You might want to respond to the OP, rather than me.
|
|
|
|
|
How to do this:
When I write one character in textBox
in other textBox to appear the ASCII code of that character.
Vasildb
|
|
|
|
|
Have you looked at ASCIIEncoding?
|
|
|
|
|
this.textBox2.Text=Encoding.ASCII.GetBytes(this.textBox1.Text)[0].ToString();
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hello,
I'd like to know if there is any way to make the DropDown part of a ComboBox open with its top-right corner aligned to the bottom-right corner of its ComboBox. Like this.[^].
Right now I'm trying to create a control of my own that inherits from a ComboBox and overriding the OnPaint and OnDrawItem methods, but I have yet to hit on a solution for this.
-M.
|
|
|
|
|
Never mind. I found something[^] that works. I don't know -how- it works or why there doesn't appear to be a simpler way, but it's better than nothing.
-M.
|
|
|
|
|
I want to create table at runtime for an existing Ms Access database using ASP.net 2.0 and C#. Can anyone please guide me through it ?
|
|
|
|
|
use the CREATE TABLE statement
CREATE TABLE tablename(
COLUMNS
)
|
|
|
|
|
Here are two SQL statements that will create table1 and then create table2 with PK, FK and inforced integrity.
string _StrSQL;
string tblName = "table1";
string tblName2 = "table2";
_StrSQL = @"CREATE TABLE " + tblName +
@" (RecID AUTOINCREMENT " +
@" CONSTRAINT PK_" + tblName + " PRIMARY KEY, " +
@" RecorderID VARCHAR WITH COMPRESSION, " +
@" GroupID VARCHAR WITH COMPRESSION, " +
@" Name VARCHAR WITH COMPRESSION, " +
@" Address VARCHAR WITH COMPRESSION)";
_StrSQL = @"CREATE TABLE " + tblName +
@"(HourID AUTOINCREMENT" +
@" CONSTRAINT PK_" + tblName + " PRIMARY KEY," +
@" RecID INTEGER NOT NULL " +
@" CONSTRAINT FK_" + tblName2 + "_" + tblName +
@" REFERENCES " + tblName2 + " (RecID) " +
@" ON UPDATE CASCADE " +
@" ON DELETE CASCADE," +
@" DSID INTEGER NOT NULL," +
@" [Month] INTEGER," +
@" [Day] INTEGER," +
@" [Year] INTEGER," +
@" [Hour] INTEGER)";
You do not have to use the '@' symboly. I use it because it make the statement easier on my eyes.
Then drop the _StrSQL in a OleDbCommand:
object _obj = null;
OleDbConnection OleConn = new OleDbConnection(_ConnString);
OleDbCommand OleComm = new OleDbCommand(_SQLString, OleConn);
OleComm.Connection.Open();
_obj = OleComm.ExecuteScalar();
OleComm.Connection.Close();
Good Luck,
Jason
Programmer: A biological machine designed to convert caffeine into code. * Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
Hi how can i upload a file from desktop application to a web directory.
I am using following code.
string fileName = @"E:\queries.txt";<br />
System.Net.WebClient client = new WebClient();<br />
client.UploadFile("http://ef-kam/Compaq/working/" + fileName, "PUT", fileName);
But i am getting following exception.
"The remote server returned an error: (501) Not Implemented."
Know Yourself Then Grow Yourself.
|
|
|
|
|
The PUT method is disabled by default in the web server. You have to enable it for the server to accept it.
---
b { font-weight: normal; }
|
|
|
|
|
thanks can u please tell me how i can enable it.
Know Yourself Then Grow Yourself.
|
|
|
|
|
|
Hi,
I need to pass values dynamically for a return type of a particular property.How could i do this.
Actually what happend is:I need to display time according to the user selected format.For that I have taken a proprty and that has constants.So for that i cant send values.I need to send the values only for the retun type.How could i do this.
|
|
|
|