Category: "Programming"
Write a wav file player in C#
That is a bit hard to write a mp3 player in C#. I think you may need to find third party mp3 decoder dll. But if you only want to play to a wav file, that is very easy. .Net libraries already have a control class for you.
Code
System.Media.SoundPlayer |
All you need to put the file name into the constructor
Code
SoundPlayer player = new SoundPlayer(FileName); |
Then you can play and stop the file by these methods:
Code
player.Play(); | |
player.Stop(); |
This afternoon, I wrote an example project for this. Moreover, this project is implemented in WPF rather than normal Windows Forms, because I wish to practice my WPF skills.
Download the example project, please click here.
C# to Skype
I found Skype has API for developers. I can using Skype4COM to allow my C# code to access Skype, so that I can make a call or send a SMS via Skype from my C# application.
There are a lot of detialed tutorials in this URL:
https://developer.skype.com/Docs/Skype4COM/Example?action=show
Importing Outlook Contact
I found a good tutorial about importing outlook contacts. Basically, you can use Outlook COM object to access the contacts.
Trust Mode
In a windows shared webhost, normally, they are giving medium level of trust mode for you. Therefore, you can access some core functions such as accessing event log. In my cases, I can't call some custom assemblies. If I run asp.net web application, I will only use full trust mode.
Resharper Alternative
I believe a number of people will say Resharper is a good reflectoring tool. But that cost money! I found an alternative product, CodeRush.The express version is free of charge. But the functions are very limited, such as renaming and promote a local variable to a class variable. Yes, there are no free lunch.