|
LINQ to XML would work, and you could write/read your own file without worrying about messing up or dealing with multiple app.config files.
I'd probably create a class lib project that you can use in multiple assemblies. Shouldn't be too hard to come up with something usable and flexible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for all your suggestions.
I have decided on the following:
Declare a section in app.config ilke this:
<section name="LogMessageReceiverConfig" type="RealTimeDelivery.Common.Logging.LogMessageReceiverConfigHandler, LogMessageReceiver"/>
The section then utilised like this:
<SecondaryIdentifiersSect>
<setting name="aaa" serializeAs="String">
<value>a1</value>
</setting>
<setting name="bbb" serializeAs="String">
<value>b1</value>
</setting>
<setting name="ccc" serializeAs="String">
<value>c1</value>
</setting>
</SecondaryIdentifiersSect>
and then accessed in code like this:
System.Configuration.ClientSettingsSection sect = (System.Configuration.ClientSettingsSection)System.Configuration.ConfigurationManager.GetSection("SecondaryIdentifiersSect");
foreach (System.Configuration.SettingElement e in sect.Settings)
{
System.Diagnostics.Debug.WriteLine(e.Name);
System.Diagnostics.Debug.WriteLine(e.Value.ValueXml.InnerText);
}
|
|
|
|
|
hello
i need a complete sample project that deployed with uml and c# .exactly i need an oop base c# project source.i searched the web but did not find a suitable one.I NEED IT JUST FOR LEARNING .
thanks in advanced.
modified on Wednesday, October 1, 2008 4:31 PM
|
|
|
|
|
Good luck, I think you are going to need it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is this HOmework? A little bit of effort won't kill you. Try first and see what you come up with. If you get stuc along the way then somebody here will be more than happy to help but people here don't take kindly to guys looking for somebody to do their homework for them.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
NO THIS IS NOT a homework .i just need it for learning .
|
|
|
|
|
In which case you need the alternative site, rentacoder.com where people provide complete solutions - for a price
The alternative is to do your own homework.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I need a million dollars. Do your own work jack***.
Blog link to be reinstated at a later date.
|
|
|
|
|
Easy, download a sample from codeproject, theres plenty here about all subjects.
Good Luck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
I am encrypting the web.config using RSA technique, and using aspnet_regiis command to do this. I successfully encrypted the <connectionstrings> and <appsettings> tags. However I got the following error while encrypting the <sessionstate> tag:-
The configuration section 'sessionState' was not found.
Failed!
The command that I used is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis <br />
-pe "sessionState" -app "/LiveOne" -prov "LOProvider"
Kindly tell me a successful way to do this.
|
|
|
|
|
Encryption is used to encrypt sections - not individual tags. Why you would want to encrypt the sessionState tag is beyond me.
|
|
|
|
|
Hi,
can anyone tell me the c# way to get the log4net root logger?
background:
there's a dll wich executes any code specified via xml (dest. assembly path, dest. method, etc.). within this dll, log4net is correctly configured and works fine.
now i want to use the same logger from any of my dest. dlls. calling LogManager.GetRepository() and navigating through some public and private fields via visual studio tells that both appenders (configured in base dll) are available. But how to access them?
|
|
|
|
|
hello everybody,
i have a datatable wich i want it to be attached in an email as excel(.xls)
in order to do that:
1. i'm exporting the datatable into an excel file.
2. i'm saving it in a specific folder.
3. i'm attaching it.
is there any way to directly attach the datatable to an email as excel file directly without exporting and saving or at lest not saving because it's working on a server an i don't want to use its space
kind regards
|
|
|
|
|
michael_jhons wrote: is there any way to directly attach the datatable to an email
Not that I can think of. An attachment has to be a physical file rather than an abstraction in memory, unless you write the data into the body of the email (rather a silly solution actually).
Why not clean up the attachment file after it has been sent? You could even clean out the attachment folder prior to sending the next email or have a job that periodically cleans the attachments, there are many options here.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thank you Mycroft for your answer, that's what i was thinking about but i wanted to be more sure
|
|
|
|
|
Sorry to ask such a basic question, actually I'm new to C#.
I want to have a non-editable combo-box on my form (where user can choose from the items, but can not edit/type a new item into the combo. The .net 2005 forms editor gives me 2 choices (i) Create a list-box, which I don't want, as I need a drop-down (ii) Create a Combo-box, but that is always editable.
In VS6, we could create a combo and then in its properties we could choose the type to be list box, but I could not find any such property in C#. Any help is appreciated.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
DropdownStyle=DropDwonList
sepel
|
|
|
|
|
ur very helpful!!!thanks for the info..
|
|
|
|
|
Use DropDownStyle property of combobox class.
|
|
|
|
|
Thank you guys for the quick help
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
You are welcome
|
|
|
|
|
do this
private void MyComboBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < 256)
e.Handled = true;
}
user can´t press any key! just select
You may try also use this for textboxes that you want to get just numbers (and backspace key)
private void MyTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar < 48) || (e.KeyChar > 57))
e.Handled = true;
if (e.KeyChar == 8)
e.Handled = false;
}
As you see this way you can avoid doind some validations like try{}catch{}
Learn the ascii code to know the keys you are allowing or not
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
This won't handle the case of somebody using the mouse to paste data or cutting data for that matter. The solutions given previously are what the OP needed in his situation. In the more general scenario that you're preempting, to be successful you need to at least ...
override OnKeyDown
override OnTextChanged
override WndProc and trap WM_PASTE and WM_CUT
... being careful to allow navigation keys like Home, End, Tab, Shift+Tab and the arrow keys if appropriate.
If you just disable all keys the UI becomes very non-standard and the user will hate you and your software!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
|
Thank you DaveyM69 for the tip. Although the solution proposed by
nelsonpaixao is not what I was looking for and my current need is perfectly addressed by making DropdownStyle=DropDwonList, I will keep this solution in mind for some later day, e.g. when I need a textbox that only accepts numbers. Thank you nelsonpaixao.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|