|
I am playing around with C# seems to be the buzz word lately so i am having a look. Feeling uncomfortably lost outside my C for Comfort zone.
i was trying to play around with simple input events IE mouse/keyboard
using System.Windows.Input
seems to be the logical place to start, but here is where i get in trouble i cant gain access to that namespace for some reason. i am using MSVS 2005.
Do u need to set permissions with the .NET configuration Mgr in Admin Tools?
i am a tad lost as u can see any help appreciated
|
|
|
|
|
The System.Windows.Input[^] namespace is available from .Net 3.0 onwards. You wont be able to access it in your VS2005.
If you want to try WPF you can go for the express versions of VS2008.
*jaans
|
|
|
|
|
Ahh excellent thanks for that, i installed .NET 3.5 and was hoping that VS2005 would be able to access everything from the framework =( bummer.
Thanks for your answer
|
|
|
|
|
Hello Friends,
I am making a setup wizard for my application i have made it successfully its work great.
Now i want that when my application install then after that it will ask for restart the system now or later.
How can i achieve this please help me.
Thanks in Advance
|
|
|
|
|
search it in google. you need a tool from microsoft called orca to do that.
|
|
|
|
|
I could not use crystal report in .NET application.I would be grateful
if anybody give me proper guideline to use crystal report in C#.NET
|
|
|
|
|
Google broken where you live ? This is a top level question - you need to read a book or some articles. No forum answer will cover it in the detail you apparently need,.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
|
I am writing a program that run on Server 2000 (DHCP) using C# .Net. I wanted to collect all the IP addresses and MAC addresses of the machines that connected to this server. Anyone who can suggest on how to do this? Thank you.
|
|
|
|
|
Hi, anyone who can help? I need this solution urgently. I have tried many methods but only able to get the local machine IP and MAC address. May be I should rephrase my question to make it clear. I have a DHCP server. there will be alot of PC connected to this server through LAN. I want to retieve the IP and MAC address of all these PCs. How can I do that?
|
|
|
|
|
how can i simplify a path?
c:\folderA\folderB\folderC\fileA.txt
can i do this?
.\folderC\fileA.txt
thanks
|
|
|
|
|
Only if you are sure that your current working directory is: c:\folderA\folderB\
Bram van Kampen
|
|
|
|
|
Hi,
How can I read data from an excel file in C#?
Best wishes
|
|
|
|
|
There is a Microsoft Toolkit for Office, you can control Excel from C# with that.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Gembox[^] do a cool .net dll. Very simple to use and you don't need Excel installed. The free version has some rows/sheets limits but is otherwise fully functional.
Dave
|
|
|
|
|
for excel 2003+,It is xml file in fact.and low versoin,i remeber CP had some article about it,you can search try.
|
|
|
|
|
No, the XML format started in 2008.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hello everyone,
I have an question about forms in C#.
This is a problem which I have had since the start of programming in C#.
This is the problem:
In the (main) Form there is a button to open another (child) Form.
But when I use that Form I would like to have the main Form to be enabled. This is no problem. But when I close the child Form I would like to disable the main Form.
But I want the main form to do this.
So not something like this:
public void createForm(){
Child child = new Child(this);
child.show();
this.Enabled = true;
}
public void show(){
this.Enabled = false;
}
public Child(Main m){
this.main = m;
}
public void Dispose(){
main.show();
}
I would rather like to have something like this:
public void createForm(){
Child child = new Child();
child.show();
this.Enabled = true;
}
public void child_Disposed(object sender, EventArgs e){
this.Enabled = false;
}
If I'm not wrong, I'll have to work with delegates. But I don't know how, can somebody help me?
|
|
|
|
|
you might be able to catch the childs onFormClosing event on the parent and the disable the parent in the handler...
read my article on Delegates And Events[^]
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Your second code looks OK, only thing is you haven't hooked the Disposed event.
public void createForm(){
Child child = new Child();
child.Disposed += this.child_Disposed;
child.show();
this.Enabled = true;
}
private void child_Disposed(object sender, EventArgs e){
this.Enabled = false;
}
|
|
|
|
|
Dear all,
I have a little problem converting a string that contains a ',' into a double.
Double needs a value devided by a dot ( or so I've read )
So , in my code , the following occurs :
string lat = p[u].X.ToString().Replace(',', '.');
MessageBox.Show(lat);
The output will be for example : 55.38978 ( which shows up perfect in the messagebox )
However, if i do the following :
MessageBox.Show(Convert.ToDouble(lat).ToString());
The output will be : 5538978
That doesn't make a whole lot of sense to me. So that dot is somehow bothering Double or am I not converting properly ?
Cheers
|
|
|
|
|
Well the problem is that double works with a komma in stead of a dot.
See it like this:
string ss = "55,5493";
string lat = ss.ToString().Replace(',', '.');
double d = Convert.ToDouble(ss);
double dd = Convert.ToDouble(lat);
MessageBox.Show("" + d);
MessageBox.Show("" + dd);
So you should change this one:
string lat = ss.ToString().Replace(',', '.');
into this one:
string lat = ss.ToString().Replace('.', ',');
Good luck
|
|
|
|
|
Hi Rick,
ToString() when applied to numbers will by default use the regional settings of your system,
which define a "decimal point" (not necessarily a period) and a "thousands separator" (not
necessarily a comma).
Parse() and TryParse() will observe the "decimal point" and ignore the "thousands separator".
If you have a number formatted one way (say West-European way, with decimal comma, and thousands
period) and parsed another way (say US way), you will get wrong results, and even an Exception
when more than one thousands separator is present.
The solution is NOT to replace periods by comma and vice versa, the solution is to apply
the appropriate settings, by using a FormatProvider or CultureInfo.
The above applies not only to doubles, but also to floats and decimals.
|
|
|
|
|
How do I write the contents of a webpage without a webbrowser? I am aware of
webBrowser.Navigate("http://www.google.com");
using (StreamWriter sw = File.CreateText(path))
{
sw.Write(webBrowser.DocumentText);
}
However, I was trying to use another way to do it without using a webBrowser.
Thanks in advance.
|
|
|
|
|
Hi,
have a look at WebRequest and HttpWebRequest classes and the GetResponse method.
|
|
|
|