Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerMessage Closed Pin
28-Oct-09 0:15
stancrm28-Oct-09 0:15 
AnswerRe: Cannot upload chinese named file into Ftp server. Pin
Richard Htin28-Oct-09 0:29
Richard Htin28-Oct-09 0:29 
QuestionHow to create something like unions in C#? Pin
CelestialCoder27-Oct-09 23:40
CelestialCoder27-Oct-09 23:40 
AnswerRe: How to create something like unions in C#? Pin
Christian Graus27-Oct-09 23:48
protectorChristian Graus27-Oct-09 23:48 
Questiontimers in windows service Pin
Chesnokov Yuriy27-Oct-09 23:26
professionalChesnokov Yuriy27-Oct-09 23:26 
AnswerRe: timers in windows service Pin
Covean27-Oct-09 23:38
Covean27-Oct-09 23:38 
AnswerRe: timers in windows service Pin
Chesnokov Yuriy27-Oct-09 23:49
professionalChesnokov Yuriy27-Oct-09 23:49 
GeneralRe: timers in windows service Pin
Sunil G 328-Oct-09 0:45
Sunil G 328-Oct-09 0:45 
Hi,

Below code will Help you


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.Timers;
using System.IO;

namespace service
{
public partial class Service1 : ServiceBase
{
Timer t = new Timer();
StreamWriter writer = new StreamWriter("C:\\Service.txt");
public Service1()
{
InitializeComponent();
}

protected override void OnStart(string[] args)
{
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
t.Interval = 60000;
t.Enabled = true;
writer.WriteLine("Service is Started");
writer.WriteLine("Timer has been started..");
writer.Flush();
}

void t_Elapsed(object sender, ElapsedEventArgs e)
{
writer.WriteLine(DateTime.Now.ToString());
writer.Flush();
}



protected override void OnStop()
{
t.Enabled = false ;
writer.WriteLine("Service is Stopped");
writer.Flush();
}
}
}


Thanks,
Sunil G.
AnswerRe: timers in windows service Pin
PIEBALDconsult28-Oct-09 11:39
mvePIEBALDconsult28-Oct-09 11:39 
Questionaccess outlook application Pin
nirmalsat27-Oct-09 23:18
nirmalsat27-Oct-09 23:18 
AnswerRe: access outlook application Pin
Christian Graus27-Oct-09 23:20
protectorChristian Graus27-Oct-09 23:20 
Questionhow to make a row bold in Excel using C# Pin
Bharti Vermani27-Oct-09 23:04
Bharti Vermani27-Oct-09 23:04 
AnswerRe: how to make a row bold in Excel using C# Pin
Christian Graus27-Oct-09 23:08
protectorChristian Graus27-Oct-09 23:08 
AnswerRe: how to make a row bold in Excel using C# Pin
Bharti Vermani27-Oct-09 23:20
Bharti Vermani27-Oct-09 23:20 
QuestionFormat string for fixed length real value in scientific representation? Pin
Mats Eurén27-Oct-09 22:42
Mats Eurén27-Oct-09 22:42 
AnswerRe: Format string for fixed length real value in scientific representation? Pin
Christian Graus27-Oct-09 23:03
protectorChristian Graus27-Oct-09 23:03 
GeneralRe: Format string for fixed length real value in scientific representation? Pin
Mats Eurén27-Oct-09 23:11
Mats Eurén27-Oct-09 23:11 
QuestionDeploying C# projects into single exe file Pin
hosseinghazanfary27-Oct-09 22:09
hosseinghazanfary27-Oct-09 22:09 
AnswerRe: Deploying C# projects into single exe file Pin
Christian Graus27-Oct-09 22:20
protectorChristian Graus27-Oct-09 22:20 
AnswerRe: Deploying C# projects into single exe file Pin
Calla27-Oct-09 22:28
Calla27-Oct-09 22:28 
AnswerRe: Deploying C# projects into single exe file Pin
vtchris-peterson28-Oct-09 5:39
vtchris-peterson28-Oct-09 5:39 
GeneralRe: Deploying C# projects into single exe file Pin
hosseinghazanfary30-Oct-09 7:34
hosseinghazanfary30-Oct-09 7:34 
GeneralRe: Deploying C# projects into single exe file Pin
vtchris-peterson30-Oct-09 8:03
vtchris-peterson30-Oct-09 8:03 
Questionproblem with move values between two running forms Pin
Mr.Kode27-Oct-09 22:00
Mr.Kode27-Oct-09 22:00 
AnswerRe: problem with move values between two running forms Pin
Christian Graus27-Oct-09 22:23
protectorChristian Graus27-Oct-09 22:23 

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.