Posts

Showing posts from February, 2016

Generate HTML Document from Code Behind Using .Net C#

using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string Name = "Alpesh D.Maniya"; StringBuilder sb = new StringBuilder(); sb.Append("<html><head><meta charset='utf-8'/><style>ul li{list-style:none;margin-top:3px;margin-bottom:3px;}h1{font-size: 23px;margin-bottom: 0px;margin-top: 0px;font-weight: normal;font-family: Arial;}h2{margin: 3px;margin-left: 0px;font-size: 16px;}h3{margin: 3px;font-size: 16px;}h4{margin: 3px;margin-left: 0px;font-size: 13px;}h5{margin: 3px;font-size: 11px;font-weight: normal;font-family: Arial;}</style></head>"); sb.Append("<body style='text-align: center;margin:auto;margin-top:0px;margin-bottom:5px;'>...

Get System Information and Send it in Email using C# .Net

Step for programme : 1.Read "systeminfo" command 2.Write it to string 3.Send Email Sample Code : using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Net.Mail; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; namespace GetSystemInfo { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; // the cmd program startInfo.FileName = "cmd.exe"; // set my arguments. dat...