Category Archive: C Sharp

Nov 25

Create Gridview from csv file in C sharp (C#)

rp_noimg_6_150_150.jpg

How to import data into Gridview from csv file by using C sharp ( C# ). Soln: //Read the data from text file string[] textData = System.IO.File.ReadAllLines(Server.MapPath(“Logs”) + \\MylogFile.log); string[] headers = textData[0].Split(‘,’);   //Create and populate DataTable DataTable dataTable1 = newDataTable(); foreach (string header in headers) dataTable1.Columns.Add(header, typeof(string), null);   for (int i = …

Continue reading »

Permanent link to this article: http://www.techxpress.in/create-gridview-from-csv-file-in-c-sharp-c/

Nov 22

Get window service information by WMI Query

How to find Window Service Name/ Service Path/ Service State for local or remote machine/server by using WMI? VBScript: arrComputers = Array(“localhost”) For Each strComputer In arrComputers WScript.Echo WScript.Echo “==========================================” WScript.Echo “Computer: ” & strComputer WScript.Echo “==========================================” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2″) Set colItems = objWMIService.ExecQuery( _ “SELECT * FROM Win32_Service”,,48) For …

Continue reading »

Permanent link to this article: http://www.techxpress.in/get-window-service-information-by-wmi-query/

Nov 22

Get Free Physical Memory Free/ Virtual Memory/ Number Of Processes by WMI

How to find OS details/ physical memory/ virtual memory/ processor information of local or remote machine?   WMI Script: VBScript: arrComputers = Array(“localhost”) For Each strComputer In arrComputers WScript.Echo WScript.Echo “==========================================” WScript.Echo “Computer: ” & strComputer WScript.Echo “==========================================” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2″) Set colItems = objWMIService.ExecQuery( _ “SELECT * FROM Win32_OperatingSystem”,,48) …

Continue reading »

Permanent link to this article: http://www.techxpress.in/get-free-physical-memory-free-virtual-memory-number-of-processes-by-wmi/

Bookmark this page