|
Hi all,
i have a question on Configuration settings of a dll .
If i want to get Configuration settings of a dll in my application how can i get that?
I am using Asp.net application .
Thanks
Thanks
Mukkanti
|
|
|
|
|
Put the settings in the web.config file.
Regards,
Rob Philpott.
|
|
|
|
|
ExeConfigurationFileMap map = new ExeConfigurationFileMap();<br />
map.ExeConfigFilename = Path to dll + "config";<br />
Configuration = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
only two letters away from being an asset
|
|
|
|
|
I have a string like:
string str = "C:\downloads\fle\abcd\xyz\myfile.exe";
Now how do I extract "myfile.exe" into another string??
Som
|
|
|
|
|
Som.Paul wrote: "C:\downloads\fle\abcd\xyz\myfile.exe"
if u tring to get the file just get it with FileInfo calss and the property FileName
if not just use the Split Method with the "\" delimitor paramter
and get the last string in the array u wiil get
Have Fun
Never forget it
|
|
|
|
|
I cannot use Fileinfo class, it will be a performance issue in my program..
Cant I do it without splitting it into arrays and then extracting??
My program has multiple loops, so that might be an performance issue as well..
Any other method??
Som
|
|
|
|
|
Do This :
<br />
string str = @"C:\downloads\fle\abcd\xyz\myfile.exe";<br />
string TTemp = str.Remove(0, str.LastIndexOf(@"\") + 1);<br />
Have Fun
Never forget it
|
|
|
|
|
use Substring() put last index of \ as start index of Substring()
hope this will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
string fileName = System.IO.Path.GetFileName(str);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Or use a RegularExpression.
But it really depends on what you're doing with the result.
|
|
|
|
|
Some people seem to have an off-day
Path.GetFileName is your friend.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Well, sure, but that's so single-purpose; one should strive to address the bigger picture.
|
|
|
|
|
|
Justim,
Create a new class that holds the data you want. eg: column name, type etc and then when you create the ListBoxItem do:
item.Tag = new MyTagClass("std_nr", DbTYpe.Int, "sometelse");
Then when you want to read back the Tag, just do:
MyTagClass theTag = ListBox.SelectedItem.Tag as MyTagClass;
Regards,
Gareth.
modified on Tuesday, March 18, 2008 11:38 AM
|
|
|
|
|
|
Justim,
Just create a new class in VS and add some properties.
eg:
private string _columnName;
public string ColumnName
{
get { return _columnName; }
}
And to set the values, change the constructor to:
public MyTagClass(string columnName)
{
_columnName = columnName;
}
When reading back the values you just do:
theTag.ColumnName
Regards,
Gareth.
|
|
|
|
|
|
Justim,
No probs.
Regards,
Gareth.
|
|
|
|
|
Hi,
i'm Trying to Retrieve the serial com Info using this code:
<br />
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort");<br />
<br />
foreach(ManagementObject Port in searcher.Get()) <br />
{<br />
string a = (string) Port.GetPropertyValue("Name");<br />
}
The Thins is that it only get's the first COM info
i have COM1 and USB Serial COM2
but i could not get the USB Serial COM2 info
ANYONE, THANKS
Have Fun
Never forget it
|
|
|
|
|
If it is just the list of serial ports in your system you want, just use the static function:
string [] allComPorts = SerialPort.GetPortNames ();<br />
It will return hardware and virtual ports.
|
|
|
|
|
THANKS a Lot
Have Fun
Never forget it
|
|
|
|
|
I am not able to fetch the current systen date into string in windows application.
my system date format is dd/MMM/yyyy
my code is:
Text = DateTime.Now.ToLongDateString();
string my_date = Text.ToString();
Even we are not able to fetch it in
String my_date=DateTime.Now.ToLongDateString
pls help
|
|
|
|
|
Cuckoo wrote: I am not able to fetch the current systen date into string in windows application.
my system date format is dd/MMM/yyyy
my code is:
Text = DateTime.Now.ToLongDateString();
string my_date = Text.ToString();
So what is "Text" and what actually happens?
|
|
|
|
|
try this
DateTime dt= new DateTime()
dt.Now("dd/MM/YYYY");
But i am not sure
|
|
|
|
|
string my_date = DateTime.Now.ToString("dd/MMM/yyyy");
Dave
|
|
|
|