SlideShare a Scribd company logo
Hello friends
C# Tutorial
Part 45:
Windows services
www.siri-kt.blogspot.com
• Windows service:
• windows service is the background process of the application(.exe) by
default windows service is supports cui features. a service is a program. a
program which is under control of windows os is called as windows service.
• windows service doesnot supports GUI features. but supports 2 gui
controls
• 1.Filesystemwatcher
• 2.timer(system.timers.timer)
• to develop windows services,.net provided a template is called as windows
service. all windows services will be stored in a location called as
"services";
• How to open services:
• start-controlpanel-Administrative tools-services.
• 2nd process:
• start-Run-services.msc
• Every windows service is a class,which must be inherited from
servicebase class. servicebase is the part of system.serviceprocess
• windows services contains 2 events
• 1.onstart()
• 2.onstop()
• 1.Filesystemwatcher:
• this control is used to get information about os files. this
controls gives information about created files, deleted files,
renamed files and changed files.
• properties:
• 1.path
• 2.filter
• 3.Includedsubdirectories
• 4.Enabledraisingevents
• events:
• 1.created
• 2.deleted
• 3.renamed
• 4.changed
• 2.timer(system.timers.timer):
• we can apply the continously action purpose using this control.
• properties:
• 1.enabled=true/false
• 2.interval
• events:
• 1.elapsed
• example on windows service (restrict the text files in the d location):
• we can develop windows service following these 4 steps
• 1.create windows service project
• 2.Addinstallers
• 3.install the service in services folder using installutil command.
• 4.start the service
• step 1:
• 1.create windows service project
• open visual studio 2012
• file -new-project-windows-windows service
• after getting service1.cs[design]
• in the service1.cs[design] add 2 controls
• 1.filesystemwatcher
• 2.timer(system.timers.timer)
• goto-filesystemwatcher-events-created(double click)
• goto-timer-properties-enabled=true interval=1000
• goto-timer-events-elapsed(double click)
• source code:
• private void fileSystemWatcher1_Created(object sender,
System.IO.FileSystemEventArgs e)
• { File.Delete(e.FullPath.ToString()); }
• private void timer1_Elapsed(object sender,
System.Timers.ElapsedEventArgs e)
• { fileSystemWatcher1.Path = "d:";
• fileSystemWatcher1.Filter = "*.txt";
• fileSystemWatcher1.IncludeSubdirectories = true;
• fileSystemWatcher1.EnableRaisingEvents = true;
• }
• goto-build-build solution-windowsservce1.exe
• copy the windowsservice1.exe
• E:7pmonlineWindowsService1WindowsService1binDebugWin
dowsService1.exe
• step 2:Add installers
• goto-service1.cs[design]-right click-Add installers after -getting-
projectinstaller.cs[design]
• in this design 2 controls are there
• 1.serviceinstaller1
• 2.serviceprocessinstaller1
• goto-serviceinstaller1-properties-servicename=suhashinifile
• starttype=manual
• goto-serviceproceeinstaller1-properties-account=localsystem
• goto-build-build solution-.exe
• step 3:
• install the service in services folder using installutil
command.
• installutil:
• using this we can install the service in the services
folder
• 1.-i(install)
• syntax:
• installutil -i ws.exe
• 2.-u(uninstall)
• syntax:
• installutil -u ws.exe
• open-vs-cross tools command-right-click-Run as Administrator
• c::e:
• e:>cd E:7pmonlineWindowsService1WindowsService1binDebug
• e:E:7pmonlineWindowsService1WindowsService1binDebug>
• 3.installutil -u ws.exe
• e:E:7pmonlineWindowsService1WindowsService1binDebug>
• installutil -i ws.exe
• the coomit phase successfully completed
• 4.start the service
• goto-services-start the service -suhashini-rightclick-start the service
For more visit our website www.siri-kt.blogspot.com
Thanks for
Watching
More Angular JS TutorialsMore C sharp (c#) tutorials
www.siri-kt.blogspot.com

More Related Content

Similar to 45c

35c
35c35c
cse581_03_EventProgramming.ppt
cse581_03_EventProgramming.pptcse581_03_EventProgramming.ppt
cse581_03_EventProgramming.ppt
tadudemise
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
Sam Bowne
 
MNSEC 2018 - Windows forensics
MNSEC 2018 - Windows forensicsMNSEC 2018 - Windows forensics
MNSEC 2018 - Windows forensics
MNCERT
 
C++ Windows Forms L05 - Controls P4
C++ Windows Forms L05 - Controls P4C++ Windows Forms L05 - Controls P4
C++ Windows Forms L05 - Controls P4
Mohammad Shaker
 
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
BIOVIA
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
DevOps4Networks
 
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
DataScienceConferenc1
 
mobile development with androiddfdgdfhdgfdhf.pptx
mobile development with androiddfdgdfhdgfdhf.pptxmobile development with androiddfdgdfhdgfdhf.pptx
mobile development with androiddfdgdfhdgfdhf.pptx
NgLQun
 
ACCUMARK EXPLORER – Thiết Lập Thông Số Cơ Bản
ACCUMARK EXPLORER  –  Thiết Lập Thông Số Cơ Bản ACCUMARK EXPLORER  –  Thiết Lập Thông Số Cơ Bản
ACCUMARK EXPLORER – Thiết Lập Thông Số Cơ Bản
Nhân Quả Công Bằng
 
Lesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System ConfigurationsLesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System ConfigurationsGene Carboni
 
DCEU 18: Docker Enterprise Platform and Architecture
DCEU 18: Docker Enterprise Platform and ArchitectureDCEU 18: Docker Enterprise Platform and Architecture
DCEU 18: Docker Enterprise Platform and Architecture
Docker, Inc.
 
UniVerse11.2 Audit Logging
UniVerse11.2 Audit LoggingUniVerse11.2 Audit Logging
UniVerse11.2 Audit Logging
Rocket Software
 
ONE Automation Platform - v11 Features and Functions
ONE Automation Platform - v11 Features and FunctionsONE Automation Platform - v11 Features and Functions
ONE Automation Platform - v11 Features and Functions
CA | Automic Software
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linux
dkylko1
 
Application Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternativeApplication Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternative
Denis Gundarev
 
Tizen Web Application Checker
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application Checker
Ryo Jin
 
Building a production ready meteor app
Building a production ready meteor appBuilding a production ready meteor app
Building a production ready meteor appRitik Malhotra
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Owain Lewis
 

Similar to 45c (20)

35c
35c35c
35c
 
Web works hol
Web works holWeb works hol
Web works hol
 
cse581_03_EventProgramming.ppt
cse581_03_EventProgramming.pptcse581_03_EventProgramming.ppt
cse581_03_EventProgramming.ppt
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
 
MNSEC 2018 - Windows forensics
MNSEC 2018 - Windows forensicsMNSEC 2018 - Windows forensics
MNSEC 2018 - Windows forensics
 
C++ Windows Forms L05 - Controls P4
C++ Windows Forms L05 - Controls P4C++ Windows Forms L05 - Controls P4
C++ Windows Forms L05 - Controls P4
 
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
(ATS3-APP13) Tips and Tricks for Monitoring and Managing Symyx Notebook Serve...
 
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
Test-Driven-Development for Networking: Making CI Work for You by Colin McNam...
 
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
[DSC Europe 23] Muhammad Arslan - A Journey of Auditlogs from Kafka to Elasti...
 
mobile development with androiddfdgdfhdgfdhf.pptx
mobile development with androiddfdgdfhdgfdhf.pptxmobile development with androiddfdgdfhdgfdhf.pptx
mobile development with androiddfdgdfhdgfdhf.pptx
 
ACCUMARK EXPLORER – Thiết Lập Thông Số Cơ Bản
ACCUMARK EXPLORER  –  Thiết Lập Thông Số Cơ Bản ACCUMARK EXPLORER  –  Thiết Lập Thông Số Cơ Bản
ACCUMARK EXPLORER – Thiết Lập Thông Số Cơ Bản
 
Lesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System ConfigurationsLesson 2 - Understanding Operating System Configurations
Lesson 2 - Understanding Operating System Configurations
 
DCEU 18: Docker Enterprise Platform and Architecture
DCEU 18: Docker Enterprise Platform and ArchitectureDCEU 18: Docker Enterprise Platform and Architecture
DCEU 18: Docker Enterprise Platform and Architecture
 
UniVerse11.2 Audit Logging
UniVerse11.2 Audit LoggingUniVerse11.2 Audit Logging
UniVerse11.2 Audit Logging
 
ONE Automation Platform - v11 Features and Functions
ONE Automation Platform - v11 Features and FunctionsONE Automation Platform - v11 Features and Functions
ONE Automation Platform - v11 Features and Functions
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linux
 
Application Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternativeApplication Streaming is dead. A smart way to choose an alternative
Application Streaming is dead. A smart way to choose an alternative
 
Tizen Web Application Checker
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application Checker
 
Building a production ready meteor app
Building a production ready meteor appBuilding a production ready meteor app
Building a production ready meteor app
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 

More from Sireesh K

Cn10
Cn10Cn10
Cn10
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
What is mvc
What is mvcWhat is mvc
What is mvc
Sireesh K
 
31c
31c31c
31cs
31cs31cs
31cs
Sireesh K
 
43c
43c43c
42c
42c42c
41c
41c41c
40c
40c40c
39c
39c39c
38c
38c38c
37c
37c37c
34c
34c34c
33c
33c33c
30c
30c30c
29c
29c29c
27c
27c27c
28c
28c28c
26c
26c26c

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 
27c
27c27c
27c
 
28c
28c28c
28c
 
26c
26c26c
26c
 

Recently uploaded

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 

Recently uploaded (20)

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 

45c

  • 1. Hello friends C# Tutorial Part 45: Windows services www.siri-kt.blogspot.com
  • 2. • Windows service: • windows service is the background process of the application(.exe) by default windows service is supports cui features. a service is a program. a program which is under control of windows os is called as windows service. • windows service doesnot supports GUI features. but supports 2 gui controls • 1.Filesystemwatcher • 2.timer(system.timers.timer) • to develop windows services,.net provided a template is called as windows service. all windows services will be stored in a location called as "services"; • How to open services: • start-controlpanel-Administrative tools-services. • 2nd process: • start-Run-services.msc • Every windows service is a class,which must be inherited from servicebase class. servicebase is the part of system.serviceprocess
  • 3. • windows services contains 2 events • 1.onstart() • 2.onstop() • 1.Filesystemwatcher: • this control is used to get information about os files. this controls gives information about created files, deleted files, renamed files and changed files. • properties: • 1.path • 2.filter • 3.Includedsubdirectories • 4.Enabledraisingevents
  • 4. • events: • 1.created • 2.deleted • 3.renamed • 4.changed • 2.timer(system.timers.timer): • we can apply the continously action purpose using this control. • properties: • 1.enabled=true/false • 2.interval • events: • 1.elapsed • example on windows service (restrict the text files in the d location): • we can develop windows service following these 4 steps • 1.create windows service project • 2.Addinstallers • 3.install the service in services folder using installutil command. • 4.start the service
  • 5. • step 1: • 1.create windows service project • open visual studio 2012 • file -new-project-windows-windows service • after getting service1.cs[design] • in the service1.cs[design] add 2 controls • 1.filesystemwatcher • 2.timer(system.timers.timer)
  • 6. • goto-filesystemwatcher-events-created(double click) • goto-timer-properties-enabled=true interval=1000 • goto-timer-events-elapsed(double click) • source code: • private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e) • { File.Delete(e.FullPath.ToString()); } • private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) • { fileSystemWatcher1.Path = "d:"; • fileSystemWatcher1.Filter = "*.txt"; • fileSystemWatcher1.IncludeSubdirectories = true; • fileSystemWatcher1.EnableRaisingEvents = true; • }
  • 7. • goto-build-build solution-windowsservce1.exe • copy the windowsservice1.exe • E:7pmonlineWindowsService1WindowsService1binDebugWin dowsService1.exe • step 2:Add installers • goto-service1.cs[design]-right click-Add installers after -getting- projectinstaller.cs[design] • in this design 2 controls are there • 1.serviceinstaller1 • 2.serviceprocessinstaller1 • goto-serviceinstaller1-properties-servicename=suhashinifile • starttype=manual • goto-serviceproceeinstaller1-properties-account=localsystem
  • 8. • goto-build-build solution-.exe • step 3: • install the service in services folder using installutil command. • installutil: • using this we can install the service in the services folder • 1.-i(install) • syntax: • installutil -i ws.exe
  • 9. • 2.-u(uninstall) • syntax: • installutil -u ws.exe • open-vs-cross tools command-right-click-Run as Administrator • c::e: • e:>cd E:7pmonlineWindowsService1WindowsService1binDebug • e:E:7pmonlineWindowsService1WindowsService1binDebug> • 3.installutil -u ws.exe • e:E:7pmonlineWindowsService1WindowsService1binDebug> • installutil -i ws.exe • the coomit phase successfully completed • 4.start the service • goto-services-start the service -suhashini-rightclick-start the service
  • 10. For more visit our website www.siri-kt.blogspot.com Thanks for Watching More Angular JS TutorialsMore C sharp (c#) tutorials www.siri-kt.blogspot.com