|
No problem - glad to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Graphics.FromHandle(...);
If you pass the handle of a control (panel eg) you can use the received object to draw on that control.
Most methods in the Graphics Object speak for themself (and there is always MSDN)
hope this helps.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
thanks V,
MSDN is where I'll head over to check out the Graphics object....I'm new to C# so any tips are always appreciated.
thx
I am who I am because of who everyone around me is.
|
|
|
|
|
Does anyone know of a C#/.NET telnet component that supports ibm 3151 terminal emulation?
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi,
I have 3 quick Vista questions.
The first question, is how can I tell if my program is running on Vista?
(I've run accross the OperatingSystem class and the Environment.OSVersion value in my googling, but I can't find out if this class should be used for Vista, or what values I'd need to look for.)
My second question, is how do I get to the users applications folders?
(I know that they're all in the C:\Users\ folder, but I don't know how to get to a specific users folder.)
My last question is to do with Services in Vista. I need to start a service from my program if it hasn't already been started. However when trying to start it (using the myservice.Start() function) I get a InvalidOperationException. I've been told that this is a security issue with the program, however running the program as administrator doesn't help. Anyone have any clue as to how to get around this problem?
Thanks in advance,
Munty
|
|
|
|
|
We have a Vista board for your questions.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Did you read his questions or just fire off the subject? They're all "how do I make my C# program do Foo", not "where in the vista control panel is foo hiding" questions.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
1. System.Environment.OSVersion.Version.Major > 5
2. Application.LocalUserAppDataPath
3. Use Net start .
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete,
Thanks for the other 2 answers. They're doing what I want them to.
Net Start doesn't work on the Vista machine I have. It gives me an "System Error 5" message.
Just to note, but the "myservice.Start()" and "Net Start "myservice"" works on my XP machine.
Some further information about the service. As long as I start the service from the Services admin tool, it does what I want it to. It's just getting the service started by the program that's the problem. (The program needs the service running in order to work.)
Any ideas?
- Munty
-- modified at 10:29 Monday 23rd July, 2007
|
|
|
|
|
The only other way that I can think to do this would be to use the Service API. This[^] code shows the C++ equivalent of what you want to do.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Adding to what Pete said,
NT is known as 5.0, XP is 5.1 and Vista is 6.0
(the next big client OS will be 7.0)
|
|
|
|
|
Hi Guys,
Thanks for the answers. I'm going to test them out now.
- Munty
|
|
|
|
|
Hi all,
I have a listview and in this i m moving items up and down but when i move up or down
an item it still remains the previous selection.
how can i remove my previous selection?
Praveen Sharma
|
|
|
|
|
The listviewItem class has a selected property on it. Set it to false.
Ben
|
|
|
|
|
I want to write a forensics toolkit, but it is not clear to me how I can adress the system resources (disks MBR, NTFS or FAT, sequential reading of each sector) with the C# language. Can somebody help me with this problem?
Lichtspel
|
|
|
|
|
To be honest, if I was wanting to do this I wouldn't use C#. It's not really designed to do this - you can, but you're going to end up doing a lot of P/Invoke and unmanaged code.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
You're right with your remark, thanks for this, but it doesn't give me an answer to my question.
As an Assembler, C and C++ programmer I know I could solve the problem easily, but the policy of my company is to work with C#, so I'm learning this language and hoped to find some answers to my question.
|
|
|
|
|
Actually, it does give you the answer. You're going to have to do P/Invoke and use unmanaged code to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi guys,
I am new to file operation in .NET.I read few articles on FileStream class.I know seek() method.But guys how can i insert some text say "xyz" at
2nd line and at 5th index.Example
File1.txt
---------
hello
billgates
how r u?
---------
output :
hello
billgxyzates
how r u?
Solution wud be appreciated.
Thank u in advance
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
You can't insert data in the middle of a file.
If the file is fairly small, just read the entire file, insert the text, and write the entire file back.
---
single minded; short sighted; long gone;
|
|
|
|
|
Is there a way I can access to the definition and implementation of the members of the TcpListener class?
|
|
|
|
|
Hi,
Microsoft has publised an "ssCLI" or "shared source CLI" which is an example of how .NET
can be implemented. It is not the code in the official version though. Google it, you will
find it right there. There is a lot to read...
And there is the Mono project, that's an open source .NET implementation for non-Windows
platforms. Freely available in source form.
|
|
|
|
|
|
Reflector for .NET[^]
Reflector allows you to decompile .Net IL and shows you the code. It is quite possibly the best tool for .Net you could possibly want.
(It's helped me inumerable times when I've needed to see the implimentation in the BCL or a 3rd party assembly)
|
|
|
|
|
Great! I'll try it. Thank U.
|
|
|
|