1. http://www.beansoftware.com/ASP.NET-Tutorials/YouTube-Video-ASP.NET.aspx
2. http://www.beansoftware.com/ASP.NET-Tutorials/Play-Flash-Video.aspx
Wednesday, May 19, 2010
Saturday, April 24, 2010
Screen scraping in C# using HtmlAgilityPack.
In my project, i have used HtmlAgilityPack library to capture the page and parse it.
1. First you create a asp.net project and add HtmlAgilityPack reference in your project.
2. Create a 'HtmlWeb' object
3. Load the html page using 'HtmlDocument'
4. now you get html page in 'HtmlDocument' object.
5. You can display this 'HtmlDocument' object in asp 'Literal' control.
the code this below
HtmlWeb hwObject = new HtmlWeb();
HtmlDocument htmldocObject = hwObject.Load("http://www.c-sharpcorner.com");
lLatestPrice.Text = htmldocObject.DocumentNode.InnerHtml;
You can find all link from this page using a loop like this
foreach (HtmlNode link in htmldocObject.DocumentNode.SelectNodes("//a[@href]"))
{
string s = link.InnerText;
}
thats it.....
1. First you create a asp.net project and add HtmlAgilityPack reference in your project.
2. Create a 'HtmlWeb' object
3. Load the html page using 'HtmlDocument'
4. now you get html page in 'HtmlDocument' object.
5. You can display this 'HtmlDocument' object in asp 'Literal' control.
the code this below
HtmlWeb hwObject = new HtmlWeb();
HtmlDocument htmldocObject = hwObject.Load("http://www.c-sharpcorner.com");
lLatestPrice.Text = htmldocObject.DocumentNode.InnerHtml;
You can find all link from this page using a loop like this
foreach (HtmlNode link in htmldocObject.DocumentNode.SelectNodes("//a[@href]"))
{
string s = link.InnerText;
}
thats it.....
Saturday, March 13, 2010
Desktop icon disable
1. http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3730
http://forums.techarena.in/software-development/1099472.htm
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace ShowHideDesktop
{
public partial class Form1 : Form
{
//[DllImport("user32.dll", EntryPoint = "FindWindowA")]
//private static extern long FindWindow(string lpClassName, string lpWindowName);
//[DllImport("user32.dll")]
//private static extern long GetWindow(long hwnd, long wCmd);
//[DllImport("user32.dll")]
//private static extern long ShowWindow(long hwnd, long nCmdShow);
////[DllImport("user32.dll")]
////private static extern long EnableWindow(long hwnd, long fEnable);
//[DllImport("user32", EntryPoint = "FindWindowExA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
//public static extern long FindWindowEx(long hWnd1, long hWnd2, string lpsz1, string lpsz2);
//[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
//public static extern long SetWindowPos(long hWnd, long hWndInsertAfter, long X, long Y, long cx, long cy, long wFlags);
//[DllImport("User32.dll")]
//public static extern int MessageBox(int h, string m, string c, int type);
[DllImport("User32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("User32.dll")]
public static extern Int32 SendMessage(int hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
void ShowDesktopIcons(bool show)
{
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
if (show)
ShowWindow(hWnd, 5);
else
ShowWindow(hWnd, 0);
}
public Form1()
{
InitializeComponent();
}
private void showIconcheckBox_CheckedChanged(object sender, EventArgs e)
{
if (showIconcheckBox.Checked)
{
// ShowHideDesktopIcons(true);
ShowDesktopIcons(true);
}
else
ShowDesktopIcons(false);
}
private void Form1_Load(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);
p.StartInfo.FileName = "taskmgr.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
const int WM_CLOSE = 0x0010;
int taskManager = FindWindow("#32770", "Windows Task Manager");
SendMessage(taskManager, WM_CLOSE, 0, 0);
}
//void ShowDesktopIcons(bool bVisible)
//{
// ShowWindow(GetWindow(FindWindow("Progman", "Program Manager"), GW_CHILD),
// (bVisible ? SW_SHOW : SW_HIDE));
//}
/////
///// method for handling the showing/hiding of the desktop icons
/////
/////
condition: show or hide
/////true/false
//public bool ShowHideDesktopIcons(bool show)
//{
// try
// {
// //get a handle to the desktop ("Progman")
// long winHandle = FindWindowEx(0, 0, "Progman", null);
// //determine if we're showing or hiding
// switch (show)
// {
// case true:
// ShowWindow(winHandle, 0);
// break;
// case false:
// ShowWindow(winHandle, 5);
// break;
// }
// return true;
// }
// catch (Win32Exception ex)
// {
// // MessageBox.Show(ex.ToString());
// return false;
// }
//}
}
}
Disable network...
1. http://www.eggheadcafe.com/community/aspnet/2/10068229/how-to-disconnect-the-int.aspx
2. http://lamahashim.blogspot.com/2010/03/disabling-network-using-c.html
3. http://www.codeguru.com/forum/showthread.php?t=328228&highlight=internethangup
4. http://www.debugging.com/bug/4715
http://forums.techarena.in/software-development/1099472.htm
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace ShowHideDesktop
{
public partial class Form1 : Form
{
//[DllImport("user32.dll", EntryPoint = "FindWindowA")]
//private static extern long FindWindow(string lpClassName, string lpWindowName);
//[DllImport("user32.dll")]
//private static extern long GetWindow(long hwnd, long wCmd);
//[DllImport("user32.dll")]
//private static extern long ShowWindow(long hwnd, long nCmdShow);
////[DllImport("user32.dll")]
////private static extern long EnableWindow(long hwnd, long fEnable);
//[DllImport("user32", EntryPoint = "FindWindowExA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
//public static extern long FindWindowEx(long hWnd1, long hWnd2, string lpsz1, string lpsz2);
//[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
//public static extern long SetWindowPos(long hWnd, long hWndInsertAfter, long X, long Y, long cx, long cy, long wFlags);
//[DllImport("User32.dll")]
//public static extern int MessageBox(int h, string m, string c, int type);
[DllImport("User32.dll")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("User32.dll")]
public static extern Int32 SendMessage(int hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
void ShowDesktopIcons(bool show)
{
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Progman", null);
if (show)
ShowWindow(hWnd, 5);
else
ShowWindow(hWnd, 0);
}
public Form1()
{
InitializeComponent();
}
private void showIconcheckBox_CheckedChanged(object sender, EventArgs e)
{
if (showIconcheckBox.Checked)
{
// ShowHideDesktopIcons(true);
ShowDesktopIcons(true);
}
else
ShowDesktopIcons(false);
}
private void Form1_Load(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);
p.StartInfo.FileName = "taskmgr.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
const int WM_CLOSE = 0x0010;
int taskManager = FindWindow("#32770", "Windows Task Manager");
SendMessage(taskManager, WM_CLOSE, 0, 0);
}
//void ShowDesktopIcons(bool bVisible)
//{
// ShowWindow(GetWindow(FindWindow("Progman", "Program Manager"), GW_CHILD),
// (bVisible ? SW_SHOW : SW_HIDE));
//}
/////
///// method for handling the showing/hiding of the desktop icons
/////
/////
condition: show or hide
/////
//public bool ShowHideDesktopIcons(bool show)
//{
// try
// {
// //get a handle to the desktop ("Progman")
// long winHandle = FindWindowEx(0, 0, "Progman", null);
// //determine if we're showing or hiding
// switch (show)
// {
// case true:
// ShowWindow(winHandle, 0);
// break;
// case false:
// ShowWindow(winHandle, 5);
// break;
// }
// return true;
// }
// catch (Win32Exception ex)
// {
// // MessageBox.Show(ex.ToString());
// return false;
// }
//}
}
}
Disable network...
1. http://www.eggheadcafe.com/community/aspnet/2/10068229/how-to-disconnect-the-int.aspx
2. http://lamahashim.blogspot.com/2010/03/disabling-network-using-c.html
3. http://www.codeguru.com/forum/showthread.php?t=328228&highlight=internethangup
4. http://www.debugging.com/bug/4715
Monday, November 2, 2009
Monday, October 19, 2009
Saturday, October 17, 2009
Silverlight Tutorial..
http://www.silverlightbuzz.com/learn-blend-in-a-month/
http://www.silverlightbuzz.com/category/silverlight-blend-tutorials/
http://www.silverlightbuzz.com/2009/10/08/using-images-and-video-in-blend/
http://www.silverlightbuzz.com/2009/10/05/importing-artwork-from-other-tools-into-blend/
A freely available plug-in that enables Adobe Illustrator to export WPF and Silverlight compatible XAML
http://www.mikeswanson.com/xamlexport/
http://www.silverlightbuzz.com/2009/10/07/using-gradients-in-blend/
http://www.silverlightbuzz.com/category/silverlight-blend-tutorials/
http://www.silverlightbuzz.com/2009/10/08/using-images-and-video-in-blend/
Importing artwork from other tools into Blend
http://www.silverlightbuzz.com/2009/10/05/importing-artwork-from-other-tools-into-blend/
A freely available plug-in that enables Adobe Illustrator to export WPF and Silverlight compatible XAML
http://www.mikeswanson.com/xamlexport/
http://www.silverlightbuzz.com/2009/10/07/using-gradients-in-blend/
Wednesday, October 14, 2009
Jquery image plugin
All jquery image gallery plugin...
http://tympanus.net/codrops/2009/09/07/42-jquery-image-gallery-plugins/
http://tympanus.net/codrops/2009/09/07/42-jquery-image-gallery-plugins/
Subscribe to:
Posts (Atom)