Click here to Skip to main content
15,919,121 members
Home / Discussions / C#
   

C#

 
AnswerRe: beginer in c# Pin
Richard MacCutchan16-Jan-12 23:10
mveRichard MacCutchan16-Jan-12 23:10 
AnswerRe: beginer in c# Pin
thatraja16-Jan-12 23:11
professionalthatraja16-Jan-12 23:11 
QuestionHow To Track [ Inserted/Updated ] Records Using ADO.NET Pin
AmbiguousName16-Jan-12 21:17
AmbiguousName16-Jan-12 21:17 
AnswerRe: How To Track [ Inserted/Updated ] Records Using ADO.NET Pin
Mycroft Holmes16-Jan-12 21:54
professionalMycroft Holmes16-Jan-12 21:54 
AnswerRe: How To Track [ Inserted/Updated ] Records Using ADO.NET Pin
BobJanova16-Jan-12 22:42
BobJanova16-Jan-12 22:42 
QuestionC# Limit number of characters user can enter - Console Application Pin
Deborah Palmer McCain16-Jan-12 12:08
Deborah Palmer McCain16-Jan-12 12:08 
AnswerRe: C# Limit number of characters user can enter - Console Application Pin
Wayne Gaylard16-Jan-12 18:46
professionalWayne Gaylard16-Jan-12 18:46 
GeneralRe: C# Limit number of characters user can enter - Console Application Pin
Deborah Palmer McCain16-Jan-12 19:04
Deborah Palmer McCain16-Jan-12 19:04 
GeneralRe: C# Limit number of characters user can enter - Console Application Pin
Wayne Gaylard16-Jan-12 19:14
professionalWayne Gaylard16-Jan-12 19:14 
AnswerRe: C# Limit number of characters user can enter - Console Application Pin
BobJanova16-Jan-12 22:39
BobJanova16-Jan-12 22:39 
GeneralRe: C# Limit number of characters user can enter - Console Application Pin
Deborah Palmer McCain17-Jan-12 4:53
Deborah Palmer McCain17-Jan-12 4:53 
Questionhow to paint lines on combo-box in difference colors ? Pin
goldsoft16-Jan-12 0:25
goldsoft16-Jan-12 0:25 
AnswerRe: how to paint lines on combo-box in difference colors ? Pin
Pete O'Hanlon16-Jan-12 0:29
mvePete O'Hanlon16-Jan-12 0:29 
GeneralRe: how to paint lines on combo-box in difference colors ? Pin
goldsoft16-Jan-12 0:38
goldsoft16-Jan-12 0:38 
AnswerRe: how to paint lines on combo-box in difference colors ? Pin
Luc Pattyn16-Jan-12 0:47
sitebuilderLuc Pattyn16-Jan-12 0:47 
GeneralRe: how to paint lines on combo-box in difference colors ? Pin
BobJanova16-Jan-12 3:43
BobJanova16-Jan-12 3:43 
Questionhelp Pin
rudra12415-Jan-12 21:03
rudra12415-Jan-12 21:03 
AnswerRe: help Pin
Mycroft Holmes15-Jan-12 21:08
professionalMycroft Holmes15-Jan-12 21:08 
AnswerRe: help Pin
OriginalGriff15-Jan-12 21:26
mveOriginalGriff15-Jan-12 21:26 
GeneralRe: help Pin
Luc Pattyn15-Jan-12 21:38
sitebuilderLuc Pattyn15-Jan-12 21:38 
AnswerRe: help Pin
thatraja16-Jan-12 2:13
professionalthatraja16-Jan-12 2:13 
QuestionWindows service Windows XP and Windows 7 Pin
Mc_Topaz15-Jan-12 20:58
Mc_Topaz15-Jan-12 20:58 
Hi!

For an application I have to learn, maintain and upgrade there is a code for installing Windows services. The code works on Windows XP, but it don't work on Windows 7 which I use.

The Windows service (Service.exe), needs two arguments for the main method. The two arguments are a string and a file path (File.txt).

This is the code for installing the service on XP:
C#
string installutilFolder; // Folder to installutil.exe
string filePath;          // Path to argument file (File.txt)
string serviceFolder;     // Path to folder for Service.exe

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = installutilFolder + @"\installutil";
process.StartInfo.Arguments = @"/i /key=""" + filePath + "\" \"" + serviceFolder + "\\Service.exe \"" ;
process.Start();

Pretty simple only the assignment is a bit weird. Notice the installutil will have two arguments:

* The string containing the file path which is the argument for the service
* The service to install

I'm happy that this actually works on Windows XP. But when I run this code on Windows 7, the services seems not to be installed, because I cannot find it where all other installed services are in Windows.

Any solution for how to install the service for Window 7? A solution which is same for Window XP and Windows 7 would be best.
AnswerRe: Windows service Windows XP and Windows 7 Pin
Luc Pattyn15-Jan-12 21:42
sitebuilderLuc Pattyn15-Jan-12 21:42 
AnswerRe: Windows service Windows XP and Windows 7 Pin
Mc_Topaz15-Jan-12 22:22
Mc_Topaz15-Jan-12 22:22 
GeneralRe: Windows service Windows XP and Windows 7 Pin
BobJanova16-Jan-12 3:48
BobJanova16-Jan-12 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.