15,896,726 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
gmhanna
10-Apr-14 8:12am
View
Hi - So what you're saying is if I put my ShareSettings.xml into the Program Data directory, like you have said (I have other things stored there already), then the service will find the settings set by the desktop application?
Do I have to do anything special such as setting a path to the program data directory so it knows where to find the ShareSettings.xml file?
Thank you,
Glenn
gmhanna
16-Mar-14 14:05pm
View
I think it's expecting me to pass some value in the variable edition, which is set to null.
gmhanna
16-Mar-14 14:00pm
View
I've coded it like this:
using (SqlConnection connection = new SqlConnection(connectionString))
{
strCreate = @"SELECT SERVERPROPERTY(@edition)";
SqlCommand command = new SqlCommand(strCreate, connection);
command.CommandType = CommandType.Text;
command.Parameters.AddWithValue("edition", edition);
connection.Open();
command.ExecuteScalar();
connection.Close();
}
Now I'm getting, SELECT SERVERPROPERTY(@edition) returned: The parameterized query '(@edition nvarchar(4000))SELECT SERVERPROPERTY(@edition)' expect the parameter '@edition', which was not supplied.
gmhanna
7-Mar-14 22:46pm
View
The DataGridView is bound to a SQL table. I dragged the Data Source onto the Windows Form, so the DELETE button is pre-wired to delete the entry in the table. I would like to remove that pre-wired delete, so I can capture information from the row being deleted, then I want to call the pre-wired delete method, or use my own.
gmhanna
7-Mar-14 22:34pm
View
In Windows Forms.
gmhanna
4-Jan-14 10:51am
View
Hello Mr. Kryukov,
I think I was having a bad day when I wrote that. I've been working with Visual Studio since 2003 when V1 was available and before that I was writing in native C for Windows using the Windows API since 1993. I have written several applications that have multiple executable programs before in VS and I know you don't need to call the file program.cs. You can just add another to your existing project. Most of my projects only have one executable so I don't usually rename program.cs.
Just to give you a little background on what I'm doing so you don't think I'm totally nuts. I'm writing an application that collects information about windows servers on a network and stores it into a SQL Server database. I am writing the client piece as a windows service (I haven't written a service before, which may explain my off the wall thinking). This service will wake up every 24 hours and update the database. Reports will run daily to help identify problems.
Thank you,
Glenn
gmhanna
21-Dec-13 11:54am
View
Hi,
I've tried your method of creating an application log, however i'm still getting the same exception: "The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security."
The exception is occurring on the CreateEventSource within the Install method:
EventLog.CreateEventSource(ApplicationName, EventLogName);
ApplicationName = "Cert", EventLogName="CommonServices"
I'm running Windows 8.1, not sure if that makes a difference or not.
Thanks,
Glenn
gmhanna
5-Dec-13 14:32pm
View
If nobody logs on though and the service is running, will it have access to the data in app.config? I'm confused by it calling it "User Data", is that associated to a UserID?
gmhanna
28-Jul-10 11:48am
View
Reason for my vote of 5
Works like a champ! -- Thank you!
Show More