|
tanks for the help.
The exception works just fine.
I think i must work harder...
|
|
|
|
|
Hi pcaeiro
You means when u type "*a" it's show will give error? If it will give error please post that error here
because of "it blows the all thing"
thanks
|
|
|
|
|
tanks for the help but i have already solve my problem.
|
|
|
|
|
Hi All,
This has to be one of the most common things I'm encountering when looking at MSDN Examples.
I'm wnating to grab a list of the logical drives on my computer. Dead simple ... ?
So I looked up some examples and found this on MSDN (i've always used Directory.GetLogicDrive();) so I thought I'd give this a try.
using System;
class Sample
{
public static void Main()
{
Console.WriteLine();
String[] drives = Environment.GetLogicalDrives();
Console.WriteLine("GetLogicalDrives: {0}", String.Join(", ", drives));
}
}
Putting the line:
String[] drives = Environment.GetLogicalDrives();
Yields an error saying that drives doesn't exist in this context. How can such a simple example not work in my code? I'm Confused!!
Jammer
Going where everyone here has gone before!
|
|
|
|
|
There is nothing wrong with that line of code. You have to show a bit more of the code where you use this.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
DOH! It was in a private method ... making that method public has fixed it.
I'm still very much getting my head around how to scope things in C#. I'm SO used to FoxPro (like 10 years worth of nothing but FoxPro) and that doesn't care what you do, like
x = 0
x = "boo!"
and it will just carry on ...
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Jammer wrote: I'm still very much getting my head around how to scope things in C#. I'm SO used to FoxPro
Then you have a lot more than just scope to get your head around...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Again,
All i'm doing is:
private static List<string> GetMachinesDirectoryList()
{
List<string> DirectoryList = new List<string>();
string[] drives = Directory.GetLogicalDrives();
return DirectoryList;
}</string></string></string>
Yet neither line works for me ... If I add a watch I just get an out of context error. All the examples out there I can find do *exactly* the same thing string[] drives = Directory.GetLogicalDrives(); so how come this doesn't work in my code?
Cheers,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Are you getting a compiler error or a runtime error? The method should look like this:
private static List GetMachinesDirectoryList()
{
string[] drives = Directory.GetLogicalDrives();
return new List<string>(drives);
}
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
using it in a private didn't work for me .. its working now that its in a public method.
weird.
Jammer
Going where everyone here has gone before!
|
|
|
|
|
System.IO.Directory.GetLogicalDrives(), I believe. Your problem is probably that the example assumes a using statement.
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 )
|
|
|
|
|
Did you get that issue with the BitmapSource sorted out?
|
|
|
|
|
I Pete,
I can't remember that particular issue! There have been so many lately they are all blurring into one mass of "eh?" heh heh ...
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Hi,
if you feel you are running from one problem to the next, and not gaining much
insight in the process, I strongly recommend you go to a book store, look into
some introductory or tutorial programming books, and choose and buy and study one,
chapter by chapter. That will teach you the basics in a logical order, provide
examples and show the right way to do things.
I am not going to recommend a specific book, since I believe it very much depends
on your programming knowledge in general and the writing style you prefer.
I do like most Microsoft books so far.
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.
|
|
|
|
|
Sound advice. I think I'm picking up a lot of stuff fairly quickly. A lot of the time it also comes down to confidence. I have too often already quickly based a mail out on codeproject only to fix the problem seconds later.
I'm currently reading up on WPF and XAML/Blend/Expression as that is what I'm working with at the day job at the moment.
I think I'm doing okish. I've got to the point with my app in 1 month that took 6 months in FoxPro.
Code Project has been incredibly helpful.
Jammer
Going where everyone here has gone before!
|
|
|
|
|
Jammer wrote: Code Project has been incredibly helpful
Yes, it is a great community, and most threads converge to useful info.
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.
|
|
|
|
|
Jammer - sorry about that. My OT was actually aimed at Christian, but there are good points between you and Luc.
|
|
|
|
|
Gotcha! I was racking my addled brain trying to think of what you might be referring too with that one.
haha ... there have been so very many issues!
Regards,
Jammer
Going where everyone here has gone before!
|
|
|
|
|
I have a method that convert a number to a letters created with c#.net.
if i wanna use this methodin excel so when someone insert a number in a cells in excel i wanna to load directly the letters corresponding to this number in the other cell.
Some one tell me to use the macros.
But i don't know how to use them. is there any help?????
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
Not a C# question, unless C# runs inside Excel now ? I think VBScript is what runs inside Office apps.
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 )
|
|
|
|
|
Christian Graus wrote: I think VBScript is what runs inside Office apps.
Nope. VBA.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Potayto - potahto :P
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 )
|
|
|
|
|
Hello you. My name is saIam, am working on a window application on C#, the application is to get records of orders from a sales point and package the orders for the day after closure, then send as an email to the manager who works in a seperate office or might even be out of town just to enable him keep track of the daily sales at various stores. i have modelled the application but could not get the mailing aspect right just couldnt the config right .please need help on setting and configuring mail in window application with c#. Many thanks in anticipation.
stay jacking
|
|
|
|
|
What do you mean by 'config' ? You're failing to set a proper SMTP server ?
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 )
|
|
|
|
|
Yes
fine, you msut give smtp server name ,port ,username ,password and etc.
this is way, please use the Appconfig file add all ur attributes.
after you can access by the configuration class in .net.
thanks
|
|
|
|