Click here to Skip to main content
15,896,726 members

Comments by gmhanna (Top 14 by date)

gmhanna 4-Dec-14 13:24pm View    
Still Chinese characters using MessageBoxW
gmhanna 12-May-14 18:40pm View    
I guess I should learn a lesson here and not try and remember what the code looks like when I'm at the office and the program is at home. This code works perfectly and doesn't throw any exception, it was the next line that was throwing the exception.

// works perfectly
if (Environment.UserDomainName == Environment.MachineName)
local = true;

// throws a domaincontroller exception when local:
Domain domain = Domain.GetCurrentDomain();

Thank you for your help,

Glenn
gmhanna 12-May-14 8:25am View    
Hi David,

Where is that information kept that I can query in C#? I've tried the Environment.UserDomainName property however that throws an exception when trying to access it when the user is not logged on to a domain controller.

Thanks,
Glenn
gmhanna 4-May-14 0:22am View    
Thank you for clearing that up. Yes, this is running on a thread that starts with WaitForConnection, out of OnStart. Where I start the next thread is where I expected the current thread to end (ReadCallback). The code is working great for the first connection, it's just waiting for the second connection is where I'm having a problem.

Glenn
gmhanna 3-May-14 23:56pm View    
Hi - I never knew if I should code a return in a catch, now I understand. I will be removing all the returns from my catch blocks.

GetSet is one of my classes that are just a bunch of getters and setters for the project.

This is running as a service on a server, so Windows Services are not available for a MessageBox, however for testing I have been lifting my code and pasting it into a WinForm test program.

It appears to me that the service is still bound to the port in the IP stack. I will run a NETSTAT in the morning just to verify what I'm thinking is true.

Thank you,
Glenn