Please remember to use "System.Timers.Timer" in Windows Service
I am implementing a Windows Service. I did a foolish mistake. I opened the design view of windows service and drag-and-drop the Timer from toolbar. Because I need the windows service to execute some code periodically. I found the timer won't triggered at all. I found that is Timer in Windows.Forms. It never works in Windows Service. You need to create a timer of System.Timers. Like the example following:
Code
System.Timers.Timer timer2 = new System.Timers.Timer(); | |
timer2.Interval = 10000; | |
timer2.Enabled = true; | |
timer2.Elapsed += new System.Timers.ElapsedEventHandler(timer2_Elapsed); |
Bizspark Camp Brisbane - Windows Azure Platform
I went to the training event for Windows Azure Platform as a part of Bizspark camp. That is a great event. Thank you, Microsoft. They organized this event for the start-up like us.
The sessions are very useful and informative too! The speaker, Steve Nagy, did a great job. We got a lot of information about Azure today!
I am interested to use Azure SQL and Compute. They are Platform as a Service. Basically, I just need to deploy the website via Visual Studio to Azure Compute and run SQL in Azure SQL. They will handle all load balancing and OS Patching. That is good for the start up companies like us. We have not a dedicated server team to do those things I can scale in or out the Azure Compute instances when the load of website changes.
The most interesting thing is Azure SQL. For Azure Compute, they charge the number of instances you used and the size of each instance. But they only charge the storage of database in Azure SQL. They will do replication and load balancing behind the scene. They won't charge CPU Usage. I don't need to scale up the server when the load is increasing. Azure SQL should give more CPU and memory resources to the SQL server I use. They can handle the load without charge. That is good for web application will query the database a lot and run some expensive queries.
Display HTML Content in ViewData
I am writing a CMS by using ASP.Net MVC. Thus, I will put the html content in ViewData. In most case, we put <%: ViewData["Content"] %> in the view. But it display <b>test</b>. "<%:" will convert the content into html encoding. The way to display is using "<%=". E.g., <%=ViewData["Content"] %>, it will display title.
I am still putting my faith on Windows Phone
I am an Android Application Developer and I am not a Windows Phone owner. But I still believe Windows Phone will have at least 25% of market share in the smart phone sector. I think Windows Phone will success in the Enterprise Market. There are a lot of companies using Exchange Server. If Windows Phone can work better with Exchange Server better than Android and iPhone, that makes sense. Windows Phone will be the best option for a lot companies as their staff phone. Moreover, Microsoft got a strong partner network. They can use their partner network to encourage the developers to develop their apps in Windows Phone. I believe only basis on these two points, Windows Phone will success!
Be aware the environment when you built a .Net application
During this year, that is a transition period from 32-bit to 64-bit. That should not be a problem in .Net application. .Net should be CPU Neutral. But sometimes, some.net dlls will call others native dlls, such as SQLite and some SQL special types. They are only for either 32-bit or 64-bit environment. Thus, please be aware of this issue.