This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CPU ID | |
string sQuery = "SELECT ProcessorId FROM Win32_Processor"; | |
ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery); | |
ManagementObjectCollection oCollection = oManagementObjectSearcher.Get(); | |
foreach (ManagementObject oManagementObject in oCollection) | |
{ | |
sProcessorID = (string)oManagementObject["ProcessorId"]; | |
} | |
//HDD ID | |
ManagementObjectSearcher searcher = new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string slnPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).Parent.Parent.Parent.FullName; | |
List<string> projects = new List<string>(); | |
foreach (string f in Directory.GetFiles(slnPath)) | |
{ | |
if (f.Contains(".sln")) | |
{ | |
string[] arr = System.IO.File.ReadAllLines(f); | |
for (int i = 0; i < arr.Length; i++) | |
{ | |
if (arr[i].StartsWith("Project")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<string> GetSolutionList() | |
{ | |
List<string> prj = new List<string>(); | |
// "VisualStudio.DTE.11.0" | |
// this represents your visual studio version | |
// 11.0 means vs2012 | |
// 10.0 means vs2010 | |
// 9.0 means vs2005 | |
for (int i = 1; i < ((EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.11.0")).Solution.Projects.Count + 1; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- first drop function | |
declare @procName varchar(500) | |
declare cur cursor | |
for select [name] from sys.objects where type = 'p' | |
open cur | |
fetch next from cur into @procName | |
while @@fetch_status = 0 | |
begin | |
exec('drop procedure ' + @procName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetHtmlPage(string _url) | |
{ | |
String strResult; | |
WebResponse objResponse; | |
WebRequest objRequest = HttpWebRequest.Create(_url); | |
objResponse = objRequest.GetResponse(); | |
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream())) | |
{ | |
strResult = sr.ReadToEnd(); | |
sr.Close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Namespaces | |
using System.IO; | |
using iTextSharp.text; | |
using iTextSharp.text.html.simpleparser; | |
using iTextSharp.text.pdf; | |
using iTextSharp.tool.xml; | |
// Lets consider your html looks like HTML. | |
string HTML = "<table style=\"width:800px;\"><tr><td style=\"width:100px;\">FOO</td><td style=\"width:10px\">:</td><td>BLABLABLA ...</td></tr></table>"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delegate void _asyncFunction(params object[] args); | |
static void Main() | |
{ | |
_asyncFunction _delegate = new _asyncFunction(Foo); | |
_delegate.BeginInvoke(new object[] { "fooo" }, null, null); | |
} | |
static void Foo(params object[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hiddenByName() { | |
// consider you have a div or table which name is dvHiddenValues | |
// consider you have a hidden inputs which name is myHdValues | |
var arrList = new Array(); | |
// that gives you the list of hidden inputs which name is myHdValues | |
var hiddenList = document.getElementById('dvHiddenValues').document.getElementsByName('myHdValues'); | |
for (var i = 0; i < hiddenList.length; i++) { | |
arrList.push(hiddenList[i].value); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Web; | |
namespace WebApp.HelperClass | |
{ | |
public class CreateThumbFromVideo | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I have ping list like Wordpress, and I'm getting it from db. | |
// string[] listToPing = dtGetPingList.Rows[0]["pinglist"].ToString().Split(','); | |
private void sendPings(string[] listToPing) | |
{ | |
for (int i = 0; i < listToPing.Count; i++) | |
{ | |
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(listToPing[i].ToString()); | |
request.Method = "POST"; | |
request.ContentType = "text/xml"; |
OlderNewer