|
Thanks for the tip. As I have never worked with active directory I'd like to ask if it is possible to query the computers on a LAN without using active directory, or is the active directory part of every windows-based LAN? I have tried to run the demo but it throws a COM exception at startup
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
Radoslav Bielik wrote:
or is the active directory part of every windows-based LAN?
No
That only works for Active Directory.
Mazy
No sig. available now.
|
|
|
|
|
|
If you want to create a game or comsething try to send a multicast message.
There is a tutorial in Here. Simply type multicast and you will get it.
|
|
|
|
|
I asked this question a while back, and the answer I got was to use P\Invoke and NetServerEnum function.
Here's a snippet of the code I used.
[StructLayout(LayoutKind.Sequential)]
internal class ServerInfo
{
public int platformid;
[MarshalAs(UnmanagedType.LPWStr)]
public string name;
public int majorver,minorver;
public int type;
[MarshalAs(UnmanagedType.LPWStr)]
public string comment;
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
ArrayList arr = GetMachine();
foreach (ServerInfo si in arr)
{
Console.WriteLine("{0} , {1}, {2}, {3}, {4}, {5}",si.name,si.comment,si.platformid,si.majorver,si.minorver,si.type);
}
[DllImport("Netapi32.dll")]
private static extern int NetServerEnum(string servername, int level, out IntPtr buffer, int maxlen,
out int entriesread, out int totalentries, uint servertype, string domain, int resumehandle);
[DllImport("Netapi32.dll")]
private static extern int NetApiBufferFree(IntPtr ptr);
private static ArrayList GetMachine()
{
int eread,etot;
IntPtr buffer;
int l = 200;
int size = Marshal.SizeOf(typeof(ServerInfo));
int res = NetServerEnum(null,101,out buffer,-1,out eread, out etot,3,null,0);
IntPtr p = buffer;
ArrayList arr = new ArrayList(etot);
for (int i = 0; i < eread; i++)
{
ServerInfo si = Marshal.PtrToStructure(p,typeof(ServerInfo)) as ServerInfo;
arr.Add(si);
p = (IntPtr)((int)p + size);
}
res = NetApiBufferFree(buffer);
return arr;
}
}
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
It's a weird Life
|
|
|
|
|
Hey Nick - thanks a lot for your code snippet, it works flawlessly! You have saved me a lot of time One more question - do you have any idea how can I get the IP address and physical address of the listed network cards?
Thanks again!
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
No problem.
Unfortunately, I can't help you with the second part.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
It's a weird Life
|
|
|
|
|
|
Works well all the time with only one active lan connection. With more then one screws up. (Like if there is the high speed connection.). Is there a way to choose what connection you want to use.
|
|
|
|
|
I don't know as I'm not much into Win API Perhaps you should ask Nick.
I just played with the code a little and will get back to it later as I've got a lot of work at the moment and this is for my personal use anyway.
rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
How can I specify that a particular subroutine/thread should be executed by a particular processor for a process running on a multiprocessor system?
norm
|
|
|
|
|
ProcessThread.ProcessorAffinity
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
|
Hi, does anyone know how to add a reference (.dll) to a c# project without using the easy way, namely witout right clicking on reference and searching for the .dll, but just by righting code?
I've searched for a "referenceAdded Event" example on internet but I didn't find one...
Thanks for answers!
|
|
|
|
|
Ermm... load the assembly at runtime?
Dim x As Reflection.Assembly = System.Reflection.Assembly.LoadFile("path")
You could use this for plug-ins ...
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
That's exactly what I needed, an example
I'm sorry but I'm new in C#
Thanks a lot!
|
|
|
|
|
I think this is a good idea to write an article about. Maybe next week I'll describe how to support (.NET DLL) plug-ins in your .NET application
Perhaps I include the VB.NET code too
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
|
dear all,
can someone plz. link me to the resources and preparation material for the Microsoft .Net C# (windows forms) certification exams.
rIsHaBh
|
|
|
|
|
http://www.microsoft.com/learning/default.asp[^]
...contains links to exam information, training material, third-party test and practice test providers, certified member benefits - everything.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
rishabhs wrote:
can someone plz. link me to the resources and preparation material for the Microsoft .Net C# (windows forms) certification exams.
Sample exams:
http://www.transcender.com[^]
Mazy
No sig. available now.
|
|
|
|
|
Just so you know this is what Heath said to the last
guy that asked about getting certified in .Net.
Heath Stewart said
"Personally, I am not certified because I really don't want to be. I know a large number of people with certifications that know crap. They studied for the tests, memorized a few things, took the tests (sometimes a couple times) and got their certs. They're still idiots."
Thank You
Bo Hunter
|
|
|
|
|
And this question prompted me to write in my personal message board on my profile page. I mean, he's going to get certified and doesn't even know how to find cert material? Every cert candidate should know about http://www.microsoft.com/traincert[^]!
My post you quoted obviously made an impression (either good or bad) and I'd appreciate knowing what you think. See http://www.codeproject.com/script/profile/whos_who.asp?id=46969[^] to post your comments.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am writing a simple checkbook application.
Does the Windows OS provide a simple dbase?
I don't want a dependency on Access or SQL Server unless they component I'd be using ships as part of the OS.
I could resort to file based storage, but I was hoping some Windows software (IE?) depended on a simple dbase, and said dbase might provide a public interface to my C# application?
Articles?
Thanks,
-Luther
|
|
|
|
|
Actually, a Jet database (.mdb file, which Access uses) doesn't require Microsoft Access at all. It simply uses the Microsoft Jet database engine that should be installed when you install MDAC 2.6 or higher, which is required for ADO.NET anyway. I might be wrong and it might be a separate download (they keep changing all that), but it'll be small and probably already installed because a lot of stuff uses it. That's probably the best database file you could use. With technologies behind it like DDL, you can even create a database from scratch, although shipping a .mdb file with a schema already created would probably be easier (almost like a template from which databases are created).
As far as SQL Server / MSDE go, this would be overkill for a simple checkboox application anyway. This is more for hard-pounding applications that need transactional services (not that a register wouldn't necessarily benefit from that), replication, user authentication and security, etc.). Besides, it's a big install and can be the cause of many headaches - especially for computer neophites.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|