Click here to Skip to main content
15,905,782 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to block website in Networkplace Pin
AhsanS28-Oct-09 1:17
AhsanS28-Oct-09 1:17 
GeneralRe: how to block website in Networkplace Pin
harold aptroot28-Oct-09 1:20
harold aptroot28-Oct-09 1:20 
General[Message Deleted] Pin
Mads11528-Oct-09 1:23
Mads11528-Oct-09 1:23 
GeneralRe: how to block website in Networkplace Pin
harold aptroot28-Oct-09 1:32
harold aptroot28-Oct-09 1:32 
General[Message Deleted] Pin
Mads11528-Oct-09 1:35
Mads11528-Oct-09 1:35 
GeneralRe: how to block website in Networkplace Pin
harold aptroot28-Oct-09 1:48
harold aptroot28-Oct-09 1:48 
GeneralRe: how to block website in Networkplace Pin
SilimSayo28-Oct-09 2:49
SilimSayo28-Oct-09 2:49 
General[Message Deleted] Pin
Mads11528-Oct-09 2:55
Mads11528-Oct-09 2:55 
GeneralRe: how to block website in Networkplace Pin
EliottA28-Oct-09 2:58
EliottA28-Oct-09 2:58 
General[Message Deleted] Pin
Mads11528-Oct-09 3:03
Mads11528-Oct-09 3:03 
GeneralRe: how to block website in Networkplace Pin
EliottA28-Oct-09 3:09
EliottA28-Oct-09 3:09 
GeneralRe: how to block website in Networkplace Pin
musefan28-Oct-09 3:50
musefan28-Oct-09 3:50 
QuestionDisplaying data records from database using any data presentation contol. Pin
santosh04228-Oct-09 0:36
santosh04228-Oct-09 0:36 
QuestionCannot upload chinese named file into Ftp server. Pin
Richard Htin27-Oct-09 23:51
Richard Htin27-Oct-09 23:51 
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 

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.