The City of knowledge
.net
c-sharp tutorial for beginner
Jul 14th
hi to all i will start the new Series for beginner in this tutorial we will cover the main thing in c sharp write your first program: [cci lang="csharp"] // Namespace Declaration using System; (more…)
Stop Playing Sounds in the Background
Apr 4th
‘ —————————————- ‘ Required Imports : ‘ ‘ System ‘ Microsoft.VisualBasic ‘ —————————————-
My.Computer.Audio.Stop()
Transform XML into HTML using XSLT
Apr 3rd
‘ —————————————- ‘ Required Imports : ‘ ‘ System.Xml.Xsl ‘ —————————————-
Dim xslt As New XslCompiledTransform
xslt.Load("theXsltFile.xslt") xslt.Transform("theXmlFile.xml", "theOutputFile.html")
Opening and closing the CD tray in .NET
Nov 26th
Microsoft .NET Framework doesn’t provide a method that you can simply call for opening or closing the CD or DVD tray of the computer drives. However, that doesn’t mean this can’t be easily accomplished by using the mciSendString from the Windows API. The project attached to this tutorial is created in Visual More >
Converting Word Documents to RTF, HTML, TXT, XML
Nov 26th
Opening and manipulating Microsoft Office Word documents (.doc) can be done rather easily using the .NET Framework. You are capable of opening, editing and creating Word documents with only a few lines of code. However, since classes for managing the Word document format are not available in the .NET Framework, More >
Shut down system using C#
Nov 26th
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- // Remember to add a reference to the System.Management assembly
- using System.Management;
- namespace ShutDown
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void btnShutDown_Click(object sender, EventArgs e)
- {
- ManagementBaseObject mboShutdown = null;
- ManagementClass mcWin32 = new ManagementClass(“Win32_OperatingSystem”);
- mcWin32.Get();
- // You can’t shutdown without security privileges
- mcWin32.Scope.Options.EnablePrivileges = true;
- ManagementBaseObject mboShutdownParams = mcWin32.GetMethodParameters(“Win32Shutdown”);
- // Flag 1 means More >
Capturing screenshots using C#
Nov 26th
On the web, there are a few tutorials that will show you how to make a screen capture similar to the one that’s created and stored in the clipboard when the “Print Screen” button is pressed. However, you will find that these tutorials are a bit too complicated for such More >
File transfers through networks and the Internet
Nov 26th
In this tutorial we’re going to build a very interesting .NET application, and based on the code here you will hopefully be able to build various applications or to help you with extending your current work.
Before digging into the code, you should know that the code you see in this tutorial More >
Convert ASCII values from hex to characters
Nov 26th
- // An object storing the hex value
- string HexValue = “4765656B7065646961″;
- // An object storing the string value
- string StrValue = “”;
- // While there’s still something to convert in the hex string
- while (HexValue.Length > 0)
- {
- // Use ToChar() to convert each ASCII value (two hex digits) to the actual character
- StrValue += System.Convert.ToChar(System.Convert.ToUInt32(HexValue.Substring(0, 2), 16)).ToString();
- // Remove More >
Unzipping compressed files using GZipStream
Nov 26th
In the previous tutorial entitled Zipping files using GZipStream we reviewed how to compress files using the System.IO.Compression namespace, and we also learned that the GZipStream class of this namespace has some limitations. If you haven’t read that tutorial, I suggest that you read it, and among other things you More >
