|
omkamal wrote:
But if you read the document further it will also say that this property holds true only when you are trying to reach a remote computer...
Sorry, I was obviously mistaken.
I guess you can try SystemInformation::ComputerName, as suggested in another post.
// Fazlul
Get RadVC today! Play RAD in VC++
http://www.capitolsoft.com
|
|
|
|
|
Naivete wrote:
Can anyone tell me how to get the name of the computer (in which the code is running) using c#?
Try this:
string s = SystemInformation.ComputerName;
Kelly Herald
Software Developer
Micronpc, LLC
|
|
|
|
|
Awesome! Thanks Kelly. I appreciate your reply. I was so surprised how come c# doesnot provide such a functionality. But shame on me, that I felt so frustrating to check every single class for it. Nor did I try different search strings.
Thanks again,
Omkumar.
omkamal
|
|
|
|
|
|
Sorry if I underestimated c#. Here you go. One more property to get the machine name...
System.Environment.Machinename
omkamal
|
|
|
|
|
Will VS.NET require Product Activation like Windows XP ?
|
|
|
|
|
I did not install it yet, but it does not look like it will need activation, because a key is provided to MSDN subscribers.
|
|
|
|
|
Hi,
I have an array of type Type[] foo;
how can i get the number of emelemts and size of this array if im passing it into an function ?
I tried foo.Count but that doesnt seem to be valid.
Any ideas ?
|
|
|
|
|
Hi ,
Try foo.Length
Cheers,
Joao Vaz
|
|
|
|
|
The first release of Magic is now available. This release includes docking windows with the look and feel of the VS.NET ones. It can host Control or Form derived objects and have context menus and floating/docked states. Go to the following website...
www.crownwood.net
The source, samples and tutorials can be downloaded and used free of charge for both personal and commercial purposes.
Phil Wright
phil.wright@crownwood.net
|
|
|
|
|
How do I simulate downcasting in C#?
public class foo
{
}
public class bar : foo
{
}
foo f = new foo();
// The following line
// causes a run-time error.
// InvalidCastException
bar b = (bar)f;
************************
The following doesn't work either.
This gives a compile error.
public class foo
{
}
public class bar : foo
{
public bar(){}
public bar(foo f)
{ this = f; }
public static explicit operator bar(foo f)
{ return new bar(f); }
}
|
|
|
|
|
AFAIK that can't be done in C#. The 'foo' object never was a 'bar' object and can't be cast in that direction. A new 'bar' reference CAN be cast into a foo reference and then back into a 'bar' reference though.
You cannot cast this way in a strongly typed language. You may be able to do this in C++ (with reinterpret_cast) but the virtual tables will be messed up and strange bugs WILL happen.
--
Peter Stephens
|
|
|
|
|
I need to build a dialogue containing a 2 columns ListView while one of them
is a TreeView format..
Does anyone know how can I do that??
Thanks a lot for your help in advance
|
|
|
|
|
Hi, I want to parse a mail from POP3.
Everything is OK except decoding a message.
For example, if I just mail to myself through a UNIX console,
I write a "Test" to Subject. i,e. "Subject: Test"
But through a Outlook Express or Other Mail Client Tool,
Subject is =?euc-kr?B?vNvAzsf... like this.
so, I must parse this encoded message. "euc-kr" is a encoding type?
then How can I convert this to UNICODE or just other type.
Please help me ^^;
|
|
|
|
|
Hi,
Does anyone know how i can load assemblies in my program at runtime or DLL's of managed code ?
Ive seen a class in System.Reflection called Assembly but i am unsure if this is what im looking for.
I am trying to create a plugin system for my program which scans a directory for DLL's and loads them up. The loading is the easy part, im just looking for a way to make my program aware that other assemblies exist and to load a default class supported by every assembly at runtime.
Hope that makes sense.
Any ideas on how i would go about this ?
Cheers
|
|
|
|
|
Hi,
You have the System.Reflection.Assembly.Load method that accepts a assembly name or a assembly ref that does precisely what you want.
Cheers,
Joao Vaz
|
|
|
|
|
I feel extremely bad about doing this, but I wrote a couple articles for CP that do just what you're looking for.
Look for "TypeLoader for .NET" for some code you can plug in to your existing application, or look for "Using reflection to extend NET programs" to get a more in-depth look at what typeloader is doing.
HTH,
James
Sonork ID: 100.11138 - Hasaki
|
|
|
|
|
Cool this has really helped me alot, i have found one sample using google search engine. Are there any others that people can point me too cause a few examples would be better
Thanks for your help anyway
|
|
|
|
|
Hi all
I am facing problem with Mobile Internet Toolkit Beta 2. After downloading it from microsoft download site, I tried to run the downloaded file "MobileIT.Exe", so that I can start developing some Mobile web application (Visual Studio.Net Beta 2 is already installed in my machine). But the exe file (MobileIT.Exe) is terminated with a message "not a valid win32 application". On second try, I wanted to run it from web page but it gave message like "Device not ready". I have Windows 2000 Advanced Server installed in my machine.
Please help.
Thanks
Kanak
|
|
|
|
|
Hi Gurus:
A Dll file was complied by VC 6.0;
The DLL exports a function :
int f(char *src, long len, char **des).
How to Call this Function in C#?
thanks in advance!
|
|
|
|
|
Dear All,
I have a COM+ Component which is coded by c# and then there is a client code in c# that call the method of that Component. However, an unhandled exception is thrown :
"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: The server process could not be started because the configured identity is incorrect. Check the username and password."
I would like to know how to solve this problem ??
marcomarco
|
|
|
|
|
Hi,
I have a composite control which contains some other controls and I want to use "event bubbling" for my winform control. Is it possible for child control to forward event to Composite control?
Any advise on this would be useful.
Thanks
|
|
|
|
|
Do you mean a child control that embedded in a composite control? Because if that's the case, it's possible to wire events such that the composite control recieves the event. Please post some code and I'll show you.
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
Thanks for responding to my post. Unfortunately I can not post any code. I’ll try to be clearer about my question this time. I have a composite control, combination of standard control (say text box). Every time any onClick happens on this child(text box) control, I want to pass this event to parent(composite) control.
-Kasturi
|
|
|
|
|
There are a million articles online that deal with using delegates and events and these are the two topics you need to understand so you know what is going on. However, I found that most rticles are prtty poor when it comes to these topics. The article that I used to gain a good understnding i the following.
http://msdn.microsoft.com/msdnmag/issues/01/08/net/net0108.asp
I modified this code to be more generic, i.e. I have a class that works as a generic event "attacher" and "detacher". It's not that pretty though.
I don't have the code with me right now, so you'd have to wait for me to whip it up again if you have the patience. Otherwise you an read the article above and just dig in. It's well written nd ver clear at least to me. I'll still whip up that sample of mine though.
Regards
Senkwe
Just another wannabe code junky
|
|
|
|