Incase you haven't seen the previous tutorial, then below is the link:
How to create a windows service
Once we are done with creating a windows service, we need to install the windows service using one of the two options: one is using InstallUtil.exe tool or using a setup.In the videos below we will see how to create a setup project and create setup installer for our windows services.
Regards
Sameer Shaik
Free Online Training VIDEOS,SAMPLES,TUTORIALS ON MCTS EXAM C#.NET(MS VISUAL STUDIO) Thanks for your support. The blog is getting bigger and better day by day. please check out : www.blog.sameershaik.com for further interesting articles on other microsoft certification examinations
Search this blog
You can search for all the topics in our blog using our google custom search now.
Search the blog
Loading
Sunday, July 25, 2010
How to create a windows service
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs
Window services are applications which run in background with no user interaction.We can create these services for many purposes like tracking the changes done to the files in a particular folder for example.In our example, we will be creating a windows service, which will create a text document at certain location on our local computer and writes the status of our service along with the time stamp.
Below is the code for the same.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
namespace WsEg1
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
FileStream fs = new FileStream(@"C:\My stuff\Work Stuff\Pdf\ServiceInfo.txt", FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("Service has been started at " + System.DateTime.Now);
sw.Close();
fs.Close();
}
protected override void OnStop()
{
FileStream fs = new FileStream(@"C:\My stuff\Work Stuff\Pdf\ServiceInfo.txt", FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("Service has been stopped at " + System.DateTime.Now);
sw.Close();
fs.Close();
}
}
}
After creating windows service we will add an installer to the project which will have the configuration information of our windows service.To know how you can an installer to a windows service, please check the video.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
Window services are applications which run in background with no user interaction.We can create these services for many purposes like tracking the changes done to the files in a particular folder for example.In our example, we will be creating a windows service, which will create a text document at certain location on our local computer and writes the status of our service along with the time stamp.
Below is the code for the same.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.IO;
namespace WsEg1
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
FileStream fs = new FileStream(@"C:\My stuff\Work Stuff\Pdf\ServiceInfo.txt", FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("Service has been started at " + System.DateTime.Now);
sw.Close();
fs.Close();
}
protected override void OnStop()
{
FileStream fs = new FileStream(@"C:\My stuff\Work Stuff\Pdf\ServiceInfo.txt", FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("Service has been stopped at " + System.DateTime.Now);
sw.Close();
fs.Close();
}
}
}
After creating windows service we will add an installer to the project which will have the configuration information of our windows service.To know how you can an installer to a windows service, please check the video.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net, study guide, sample questions, Exam Prep, Exam Practice Test
Saturday, July 24, 2010
Application Domain Tutorial Part 3
APPLYING HOST EVIDENCE TO AN APPLICATION DOMAIN:
If you haven't gone through my previous tutorial then please do, below are the links:
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
If you haven't gone through my previous tutorial then please do, below are the links:
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs
Application Domain Tutorial Part 2
As we have seen that we can restrict access to any resource for an assembly. Now what if you want to provide some access privileges and restrict some access privileges for an application domain? How would you do it? Answer is quite simple, you do it the same way you did for an assembly.First create a host evidence object array and then create EVIDENCE for the application domain. You can pass the EVIDENCE as a parameter to CreateDomain Method.
I will upload a video on this post soon.
Meanwhile, below is the code for creating an application domain with configured access privileges and with custom properties set.
Watch the video to learn how to configure application domain:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
object[] hEvidence = {new Zone(System.Security.SecurityZone.MyComputer) };
Evidence AppEvidence = new Evidence(hEvidence,null);
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = System.Environment.CurrentDirectory;
setup.DisallowCodeDownload = false;
setup.DisallowBindingRedirects = false;
setup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain",AppEvidence,setup);
//d.ExecuteAssembly(@"C:\Users\Owner\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.exe");
d.ExecuteAssemblyByName("HelloWorld");
Console.WriteLine("\n");
Console.WriteLine(setup.ApplicationBase);
Console.ReadKey();
AppDomain.Unload(d);
}
}
}
As we have seen that we can restrict access to any resource for an assembly. Now what if you want to provide some access privileges and restrict some access privileges for an application domain? How would you do it? Answer is quite simple, you do it the same way you did for an assembly.First create a host evidence object array and then create EVIDENCE for the application domain. You can pass the EVIDENCE as a parameter to CreateDomain Method.
I will upload a video on this post soon.
Meanwhile, below is the code for creating an application domain with configured access privileges and with custom properties set.
Watch the video to learn how to configure application domain:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
object[] hEvidence = {new Zone(System.Security.SecurityZone.MyComputer) };
Evidence AppEvidence = new Evidence(hEvidence,null);
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = System.Environment.CurrentDirectory;
setup.DisallowCodeDownload = false;
setup.DisallowBindingRedirects = false;
setup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain",AppEvidence,setup);
//d.ExecuteAssembly(@"C:\Users\Owner\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.exe");
d.ExecuteAssemblyByName("HelloWorld");
Console.WriteLine("\n");
Console.WriteLine(setup.ApplicationBase);
Console.ReadKey();
AppDomain.Unload(d);
}
}
}
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
Friday, July 23, 2010
Application Domain Tutorial Part 2
If you haven't gone through my previous tutorial then please do, below is the link:
Application Domain Tutorial Part 1
CONFIGURING APPLICATION DOMAINS
------------------------------------------------
We need configure application domains to create customized environments for the assemblies.If you run an assembly with full trust access then one: There is no point of running that assembly in an application domain and Two: Your application domain becomes vulnerable for any security risks.
So one way to limit access privileges to the assemblies is by using EVIDENCE. Evidence is the access privileges information of the assembly which is gathered by runtime.You need add System.Security.Policy namespace to be able to create Evidence for an assembly.In our previous example we ran an assembly in an application domain using ExecuteAssembly Method.Now in this example, we will use ExecuteAssemblyByName method to run an assembly with access privileges limited to local computer.Remember you can do the same using ExecuteAssembly Method as well.
Watch this video from here:
To be continued in next video.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
object[] hEvidence = {new Zone(System.Security.SecurityZone.MyComputer) };
Evidence AppEvidence = new Evidence(hEvidence,null);
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain");
d.ExecuteAssemblyByName("HelloWorld",AppEvidence);
AppDomain.Unload(d);
}
}
}
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
Application Domain Tutorial Part 1
CONFIGURING APPLICATION DOMAINS
------------------------------------------------
We need configure application domains to create customized environments for the assemblies.If you run an assembly with full trust access then one: There is no point of running that assembly in an application domain and Two: Your application domain becomes vulnerable for any security risks.
So one way to limit access privileges to the assemblies is by using EVIDENCE. Evidence is the access privileges information of the assembly which is gathered by runtime.You need add System.Security.Policy namespace to be able to create Evidence for an assembly.In our previous example we ran an assembly in an application domain using ExecuteAssembly Method.Now in this example, we will use ExecuteAssemblyByName method to run an assembly with access privileges limited to local computer.Remember you can do the same using ExecuteAssembly Method as well.
Watch this video from here:
To be continued in next video.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
object[] hEvidence = {new Zone(System.Security.SecurityZone.MyComputer) };
Evidence AppEvidence = new Evidence(hEvidence,null);
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain");
d.ExecuteAssemblyByName("HelloWorld",AppEvidence);
AppDomain.Unload(d);
}
}
}
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
Wednesday, July 21, 2010
Application Domain Tutorial Part 1
CREATING APPLICATION DOMAINS
--------------------------------------------
Video tutorial part-1
Video tutorial part-2
Application Domain:
An application domain is a logical container that allows multiple assemblies to run within a single process.Each application domain can be configured with different security access levels.
In our example we will create a simple application and then we will try to run this application within a domain that we will create.So first create an application and then we will create an application domain.
First create a hello world application like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is a hello world application running an application domain");
Console.ReadKey();
}
}
}
Once you created an application.You can run this application under a particular domain. In our example we will start another console application and create an application domain. We can run any application or assemblies by providing the path of assembly/exe file in ExecuteAssembly Method as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain");
d.ExecuteAssembly(@"C:\Users\Owner\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.exe");
AppDomain.Unload(d);
}
}
}
Will be uploading the video tutorials on this in a while.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
--------------------------------------------
Video tutorial part-1
Video tutorial part-2
Application Domain:
An application domain is a logical container that allows multiple assemblies to run within a single process.Each application domain can be configured with different security access levels.
In our example we will create a simple application and then we will try to run this application within a domain that we will create.So first create an application and then we will create an application domain.
First create a hello world application like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is a hello world application running an application domain");
Console.ReadKey();
}
}
}
Once you created an application.You can run this application under a particular domain. In our example we will start another console application and create an application domain. We can run any application or assemblies by providing the path of assembly/exe file in ExecuteAssembly Method as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Policy;
namespace AppdomainEx1
{
class Program
{
static void Main(string[] args)
{
AppDomain d = AppDomain.CreateDomain("HelloWorldDomain");
d.ExecuteAssembly(@"C:\Users\Owner\Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\bin\Debug\HelloWorld.exe");
AppDomain.Unload(d);
}
}
}
Will be uploading the video tutorials on this in a while.
Regards
Sameer Shaik
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net.
Sunday, July 4, 2010
Learning regular expression step by step tutorials: Step 5
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs
| ||||||||
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net. |
Learning regular expression step by step tutorials: Step 4
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs and Interviews | |||||||||
|
Free Microsoft MCTS 70-536 Examination Training and Preparation for Jobs and Interviews
Tags: Microsoft MCTS exam, Learn, Tutorials, Free C#, Free Videos, Microsoft Dot Net Jobs,Microsoft Dot Net Jobs Interview, Free Training and Preparation, Jobs MCTS specialization, visual studio.net. |
Thursday, July 1, 2010
Books suggested for MCTS 70-536 examination
I know you would want to make sure that you pass this exam, to be able to do that we all need good resources. I agree.
However i do not think i can suggest you to read a combination of book which can guarantee that you have prepared everything.
These are the resources you will be getting information from:
-> Microsoft .NET Framework 2.0 Application Development Foundation Training Kit, ISBN: 0-7356-2277-9
->MSDN Library
o Microsoft Press: Programming Visual C# 2005: The Language, ISBN: 0-7356-2181-0
or
o Microsoft Press: Programming Visual Basic 2005: The Language, ISBN: 0-7356-2183-7
-> Optional books:
o Microsoft Press: Programming Visual C# 2005: The Base Class Library, ISBN: 0-7356-2308-2
or
o Microsoft Press: Programming Visual Basic 2005: The Base Class Library, ISBN: 0-7356-2308-8
o Microsoft Press: Microsoft Visual C# 2005: Step By Step, ISBN: 0-7356-2129-2
or
o Microsoft Press: Microsoft Visual Basic 2005: Step By Step, ISBN: 0-7356-2131-4
These are resources that can give you complete information.
Best of Luck
Regards
Sameer Shaik
However i do not think i can suggest you to read a combination of book which can guarantee that you have prepared everything.
These are the resources you will be getting information from:
-> Microsoft .NET Framework 2.0 Application Development Foundation Training Kit, ISBN: 0-7356-2277-9
->MSDN Library
o Microsoft Press: Programming Visual C# 2005: The Language, ISBN: 0-7356-2181-0
or
o Microsoft Press: Programming Visual Basic 2005: The Language, ISBN: 0-7356-2183-7
-> Optional books:
o Microsoft Press: Programming Visual C# 2005: The Base Class Library, ISBN: 0-7356-2308-2
or
o Microsoft Press: Programming Visual Basic 2005: The Base Class Library, ISBN: 0-7356-2308-8
o Microsoft Press: Microsoft Visual C# 2005: Step By Step, ISBN: 0-7356-2129-2
or
o Microsoft Press: Microsoft Visual Basic 2005: Step By Step, ISBN: 0-7356-2131-4
These are resources that can give you complete information.
Best of Luck
Regards
Sameer Shaik
Subscribe to:
Posts (Atom)