|
I want to select the file and i want to get the path of the file like(browsefile dialog,savefiledialog,openfiledialog)i can`t use the above dialogs because i just
want to select the file and getting path.
(ex:openfiledialog ->browser window we have option "open"->i don`t need this option
i want like "select" option (and i want to select the file not the folder)
how can i do this in c#.. help me
madhu
|
|
|
|
|
madhugurukul wrote: can`t use the above dialogs because i just
want to select the file and getting path.
Say what ? Why can't you use those ? They do exactly what you want, select the file and tell you the path.
Just use the SelectedFile property, or whatever it is. Just because there's an open method, doesn't mean you need to use it ( I never have )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i cant use those property because in that dialog (ie openfile or savefile..) when it show it is going
to have the option like "open" or "save" but i dont want to open the file or save the file ok
i just want to select the file
suppose if i use openfiledialog then user will clik "open" option user will feel that the file is
opened but i dont want to open the file
i just asking is there any info about fileselect dialog
-- modified at 4:27 Thursday 15th November, 2007
|
|
|
|
|
FileInfo o = new FileInfo("c:\\file.dat");
// o.Name
// o.FullName
// o.Extension
// o.Extension
// o.DirectoryName
Does this help ??
Wisdom is often meant as the ability and desire to make choices that can gain approval in a long-term examination by many people.
|
|
|
|
|
This is bizarre. How will your file dialog differ ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Does any one know how to do this? I want to set object y equal to object x. I only know the name of x because it's name is contained in someString.
object x = new object();
string someString = "x"; // string set to object name
//problem is here:
object y = (the object whose name is contained in the variable someString i.e. "x")
In case you are wondering why I need such a thing.... In my app someString is actually looked up in a table. It's a long story, as usual.
|
|
|
|
|
maybe...
same type object can just matching...
under follow...
object x = new object();
object y = x;
r u wanna that? or the other means?
.. knodark
|
|
|
|
|
REflection is what you need, if you have the name of the variable as a string and need to get the variable.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can you point me to a keyword or something I plug into google to get more specific info?
Thanks
|
|
|
|
|
Reflection, reflection, reflection...
cycle through the objects and compare the object names against your string.
|
|
|
|
|
Thanks for your read...
Well... Somethimes define propery in user class
for example...
public sealed myClass
{
private int _myValue;
public int MyValue
{
get { return this._myValue; }
set { this.myValue = value; }
}
}
Well... can i acccess arraylist in user class ??
for example...
public sealed myClass
{
private ArrayList _arMyList;
public ArrayList arMyList
{
}
}
and how can i define get & set property ?
just same general rules ???
.. knodark
|
|
|
|
|
Did you try ? Yes, it works the same way. Note though, because an arraylist is a reference property, if you define a get, someone can do myClass.myArray.Clear() and it's cleared in your class instance.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How to create multilingual word documents programetically using c#.net?
|
|
|
|
|
hi all,
I need to monitor a folder (also for the subdirectories) for changes or renaming. i am trying to use the File system watcher control and has set the path of the directory.
i have written code in the rename event of filesystem watcher
public void OnRenameEvent(Object sender, RenamedEventArgs e)
{
MessageBox.Show(e.OldName);
}
i have set the EnableRaisingEvents as true. but still when i am trying to rename the folder, the event is not getting triggered.
What am i missing here?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
|
hi everyone
set rsdate=conn.execute("select dateentered from mtallotment where id=" & request.querystring("id"))<br />
if not rsdate.eof then<br />
DateFolder=month(rsdate(0)) & "" & day(rsdate(0)) & "" & year(rsdate(0))<br />
end if
the above code is written previously by my senior for asp page the same task i want to do in c#.net. in this code i am getting date from the database table and checking for the folder with date as a name of the folder i want create a variable with folder name as date from database table
(eg: date:10/14/2007 ---->foldername:10142007)
awaiting for u responses
regards
|
|
|
|
|
sunilwise wrote: DateFolder=month(rsdate(0)) & "" & day(rsdate(0)) & "" & year(rsdate(0))
This line can be translated as this:
DateTime dt = DateTime.Parse(rsdate);
string FolderName = String.Format("{0}{1}{2}",dt.Month,dt.Day,dt.Year);
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
thanx for u r reply Mr.Andrei Ungureanu its workin fine;);)
|
|
|
|
|
That is not a good way to format the date, as different dates will share the same folder. For example, the dates 2007-01-11 and 2007-11-01 will both become "1112007".
If you really need to create that format anyway, you can use .ToString("Mdyyyy") to format a date that way.
A better format would be "MMddyyyy", as that would give a unique value for each date, so 2007-01-11 becomes "01112007" and 2007-11-01 becomes "11012007".
An ever better format would be to follow the ISO 8601 order "yyyyMMdd". This is unambigous (as opposed to the dd/MM/yyyy and MM/dd/yyyy formats), and you even get the folders in date order in the explorer.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
|
It was going pretty well, till ....
g_hemanth17 wrote: Can any one send me the code
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
use masked text box it will help u
|
|
|
|
|
Thankyou very much for this email, but may i know what is that for? And what am i supposed to do with this?
Email i just received is as follows:
This is a direct email response to your message on the page "C#". This message has not appeared on the discussion board for that page.
Message from g_hemanth17 <*Email Deleted*>:
i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox...
///////////////////////////////////////////////////////////////////////////////
private void onKeyPress(object sender, KeyPressEventArgs e)
{
char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' };
bool blnNumFnd = false; //for keeping track of decimal
foreach (char c in myNum)
{
if (e.KeyChar == myNum[11])
{
String txt = ((TextBox)sender).Text;
if (!txt.Contains("."))
{
blnNumFnd = true; //means its decimal value and user can't enter another decimal again!
break;
}
}
else if (e.KeyChar == c)
{
blnNumFnd = true;
break;
}
}
if (!blnNumFnd)
e.KeyChar = '\0';
}
---------------
it will take . for only 1 time..like this i want for + and - in the same text box can u try it
hemanth
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice.
Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Here's the problem. First of all, you asked this once before and got a ton of responses. If you can't work out how to follow our advice, then give up what you're doing, buy a book and learn some C# so you're capable of taking advice.
Second, while this solution is pretty nasty, it should put you on the right track to taking the advice I gave you earlier today.
Finally, when someone takes the time to do your job for you, you should show some gratitude instead of complaining that it doesn't do the job you're being paid to do and cannot work out for yourself.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|