摘要:
>The Function: Public Sub ExportDatasetToExcel(ByVal ds As DataSet, ByVal strExcelFile As String) Dim conn As New OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile 阅读全文
posted @ 2012-04-01 20:48
sandeepparekh9
阅读(182)
评论(0)
推荐(0)
摘要:
1. Add List box on a Forms. 2. Now add a reference to System.Diagnostics Code: Process[] curProcesses = Process.GetProcesses(); foreach (Process p in curProcesses) { listBox1.Items.Add(p.ProcessName); } Output: 阅读全文
posted @ 2012-04-01 20:47
sandeepparekh9
阅读(156)
评论(0)
推荐(0)
摘要:
Here Is The Class: using System;using System.Drawing;using System.Windows.Forms;namespace MoveControl{ sealed class clsMoveControl { public enum Direction { Any, Horizontal, Vertical } public static void StartMoving(Control cntrl) ... 阅读全文
posted @ 2012-04-01 20:44
sandeepparekh9
阅读(174)
评论(0)
推荐(0)
摘要:
Let's Say i have following array: string[] myArray = new string[6]; myArray[0] = "a"; myArray[1] = "b"; myArray[2] = " "; //space myArray[3] = "c"; myArray[4] = ""; //null myArray[5] = "d"; I want to remove the space and null par... 阅读全文
posted @ 2012-04-01 20:43
sandeepparekh9
阅读(164)
评论(0)
推荐(0)
摘要:
Just a small Application i made to change wallpapers automatically at regular interval. Screen: I works fine with Windows XP and windows 7 . Well, i wont go to deep in code here is the complete project. enjoy. Download: Wallpaper Changer 阅读全文
posted @ 2012-04-01 20:42
sandeepparekh9
阅读(197)
评论(0)
推荐(0)
摘要:
Once i was working with the Microsoft's PictureBox control. I noticed the each time i want to change the image i will have to create an Image object and Load my Image into and Assign it to PictureBox . And if i want to see the old pic (before assigning to new) i will have to again do the same. S 阅读全文
posted @ 2012-04-01 20:37
sandeepparekh9
阅读(151)
评论(0)
推荐(0)
摘要:
We will be Accomplishing using the Windows Registry. Main Registry to work here is : "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products" Just Write Down The Following Code the Form's Loading Event (Form Contains No Control): C#.NET private void Form1_Load(o 阅读全文
posted @ 2012-04-01 20:34
sandeepparekh9
阅读(198)
评论(0)
推荐(0)
摘要:
MySql Query : SELECT COLUMN_NAME , DATA_TYPE , CHARACTER_MAXIMUM_LENGTH , NUMERIC_PRECISION , NUMERIC_SCALE , EXTRA , COLUMN_KEY , COLUMN_DEFAULT , IS_NULLABLE , COLUMN_COMMENTFROM INFORMATION_SCHEMA.COLUMNSWHERE table_name = 'YourTableName' ... 阅读全文
posted @ 2012-04-01 20:31
sandeepparekh9
阅读(175)
评论(0)
推荐(0)
摘要:
>MySql Query: SELECT TABLE_NAMEFROM INFORMATION_SCHEMA.TABLESWHERE TABLE_SCHEMA = 'test' Example OutPut: 阅读全文
posted @ 2012-04-01 20:30
sandeepparekh9
阅读(283)
评论(0)
推荐(0)
摘要:
Stopwatchinstance can measure elapsed time for one interval, or the total of elapsed time across multiple intervals. In a typicalStopwatchscenario, you call theStartmethod, then eventually call theStopmethod, and then you check elapsed time using theElapsedproperty. (From MSDN) Let say i want to fi. 阅读全文
posted @ 2012-04-01 20:28
sandeepparekh9
阅读(244)
评论(0)
推荐(0)
摘要:
Ever Thought if it was possible to not WebBrower control and use the Firefox Browser in your c# window Application...?? Yes ,, It is possible using GeckoFx wrapper class for C#.net and vb also. You will need the Followings: 1. GeckoFx Wrapper [Download] 2. Xul Runner [Download] (Download the zip ... 阅读全文
posted @ 2012-04-01 20:26
sandeepparekh9
阅读(1493)
评论(2)
推荐(0)
摘要:
I will just go with the Example as its SelfExclamatory. Sql Query:declare @string varchar(500)set @string = 'ABC,DEF,GHIJK,LMNOPQRS,T,UV,WXY,Z'declare @pos INTdeclare @piece varchar(500)-- Need to tack a delimiter onto the end of the input string if one doesn’t existif right(rtrim(@string),1 阅读全文
posted @ 2012-04-01 20:24
sandeepparekh9
阅读(171)
评论(0)
推荐(0)
摘要:
This a simple Stored procedure to count the total numbers of rows in each table of your Database. I assume you have Northwind database installed. The Stored ProcedureIF EXISTS ( SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[sp_GetRowsCountForAllTables]') ... 阅读全文
posted @ 2012-04-01 20:22
sandeepparekh9
阅读(189)
评论(0)
推荐(0)
摘要:
I assume You have Northwind Database. I will be using The Employee Table. As Show in the figure there are 6 Selected cells which are the Duplicates( Just assume it) I want to find this number ( i mean 6.) The query for the above is: SELECT Title , COUNT(Title) AS NumOccurrencesFROM dbo.E... 阅读全文
posted @ 2012-04-01 20:18
sandeepparekh9
阅读(127)
评论(0)
推荐(0)
摘要:
Here is the Script: USE Northwind GOCREATE TABLE #temp ( table_name SYSNAME , row_count INT , reserved_size VARCHAR(50) , data_size VARCHAR(50) , index_size VARCHAR(50) , unused_size VARCHAR(50) )SET NOCOUNT ONINSERT #temp EXEC sp_msforeachtable 'sp_spaceused ''?'''... 阅读全文
posted @ 2012-04-01 20:15
sandeepparekh9
阅读(150)
评论(0)
推荐(0)
摘要:
This is simple sql query:USE masterGoIF EXISTS ( SELECT name FROM sys.databases WHERE name = 'MyDataBase' ) PRINT 'Exists'ELSE PRINT 'Does Not Exists' 阅读全文
posted @ 2012-04-01 20:12
sandeepparekh9
阅读(303)
评论(0)
推荐(0)
摘要:
NET Framework 3.0 consists of four major new components: Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies. See WPF SDK for developer article.. 阅读全文
posted @ 2012-04-01 19:59
sandeepparekh9
阅读(365)
评论(0)
推荐(0)
摘要:
Imports System.SecurityImports System.Security.CryptographyImports System.IOImports System.Runtime.InteropServicesImports System.Text.RegularExpressionsImports System.Text Encryption: Public Function Encrypt(ByVal plainText As String) As String Dim passPhrase As String = "yourPassPhrase" . 阅读全文
posted @ 2012-04-01 19:57
sandeepparekh9
阅读(483)
评论(0)
推荐(0)
摘要:
Let 's Say I have Following Array: string[] st = new string[5]; st[0] = "Animation"; st[1] = "Action"; st[2] = "Romance"; st[3] = "Drame"; st[4] = "Comedy"; Now I want to Merge all of it with ',' Delimiter Like Below: Output : Animation,A 阅读全文
posted @ 2012-04-01 19:56
sandeepparekh9
阅读(176)
评论(0)
推荐(0)
摘要:
In this post i will show you how to read the Tags like Album,Artist,Song Title,Year etc from mp3 , avi , ogg, Asf, Divx, png etc.. You will need Taglib - Sharp Library for this purpose . Download the Library :http://download.banshee.fm/taglib-sharp/ you will findtaglib-sharp.dll That's what we n 阅读全文
posted @ 2012-04-01 19:54
sandeepparekh9
阅读(239)
评论(0)
推荐(0)
摘要:
In This Post I will Guide u To making a Simple Gmail Client to send Your Emails using Gmail Account Using Vb.net Let me Show You how final Result will Look Like: 1. For Sending Mail Through Vb.net. This Client Uses "Imports System.Net.Mail". So First Import it to your Code Imports System.N 阅读全文
posted @ 2012-04-01 19:53
sandeepparekh9
阅读(306)
评论(0)
推荐(0)
摘要:
For example : let's say you have following Text:Title Author Product* ~~~~~ ~~~~~~ ~~~~~~~~ "Aurora's Eggs" Douglas Niles Story (Dragons 2)The Dragons Douglas Niles Novel The ... 阅读全文
posted @ 2012-04-01 19:50
sandeepparekh9
阅读(181)
评论(0)
推荐(0)
摘要:
Properties: Source Code: Variables PointF pf; SizeF sf = new SizeF(); public enum ImageAlign { Custom, TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, ... 阅读全文
posted @ 2012-04-01 19:48
sandeepparekh9
阅读(214)
评论(0)
推荐(0)
摘要:
Sometimes you have so many controls on your design form that can make you confused. So i have developed a Dashed Label Control which provide each control a boundry in Design Mode only. For better Understanding see the Screen Shots Below: Design ModeAt Run Time I hope your getting what i am saying. . 阅读全文
posted @ 2012-04-01 19:43
sandeepparekh9
阅读(163)
评论(0)
推荐(0)
摘要:
3d- Pie chart Control for .net Framework This one is not Made By me. Reference:http://www.codeproject.com/KB/graphics/julijanpiechart.aspx Dll: You can Download The Control Dll from above website. Now for the Coding : Simply add the dll to your project through : ToolBox -> Choose items > Your 阅读全文
posted @ 2012-04-01 19:38
sandeepparekh9
阅读(314)
评论(0)
推荐(0)
摘要:
I have tried so hard to find a transparent textbox on the web but all in vain. so i have tried to create a one.. This a User Control not a Custom Control so it has less functionality that the traditional texbox but i have tried to cover most of the important properties. here are some pics.. Thi... 阅读全文
posted @ 2012-04-01 15:07
sandeepparekh9
阅读(261)
评论(0)
推荐(0)
摘要:
A Professional Looking Label Some Picks: Without Glossy Effect With Glossy Effect Coding This on Inherits Label Sopublic partial class ProfLabel : Label Properties public string _Text; private Color _SecondBackColor = Color.Silver; public Color SecondBackColor { g... 阅读全文
posted @ 2012-04-01 15:03
sandeepparekh9
阅读(231)
评论(0)
推荐(0)
摘要:
Here comes a Custom Label Control A pic to controls Extended Properties and Control i have created a smart tag for this one.. like those inMicrosoftcontrols..See the below PicHere is the Coding :This Control Inherits the Label so:public partial class ExtendedLabelR : LabelAdd the Below Line before.. 阅读全文
posted @ 2012-04-01 15:01
sandeepparekh9
阅读(194)
评论(0)
推荐(0)
摘要:
Here is Another User Control A pick to of The Control:As you can see this one contains a Listbox and 7 buttons for the Add,Remove,up,down,,RemoveAll,Top,Bottom etc1. Add a user control to project. Add a list box and 7 button as show in the figure.Coding:Properties This is For Left/Right Side Butto.. 阅读全文
posted @ 2012-04-01 14:58
sandeepparekh9
阅读(161)
评论(0)
推荐(0)
摘要:
hi. I really needed a Richtext box with Word like functionality.. i mean Bold,Italic etc etc Function. So i decided to write a Custom Control for this Purpose. Extended RichTextBox Contains Following Controls 1. Rich Text Box [ rtxtBox ] 2. A tool Strip with Basic button including word Formatting .. 阅读全文
posted @ 2012-04-01 14:56
sandeepparekh9
阅读(6877)
评论(0)
推荐(0)
摘要:
It's Very Easy to make a Numeric only TextBox .. Just right the Following Code on The Textbox's KeyPress Event.. private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar > 31 && (e.KeyChar < '0' || e.KeyChar > '9')) { e.Handled = ... 阅读全文
posted @ 2012-04-01 14:53
sandeepparekh9
阅读(156)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Text;using System.IO;class clsLog{ private StringBuilder strLog; private string strFileName = string.Empty; //Initialize Logging //##################################################################################################... 阅读全文
posted @ 2012-04-01 14:52
sandeepparekh9
阅读(117)
评论(0)
推荐(0)
摘要:
public string GetLocalHostName() { return System.Net.Dns.GetHostName(); } 阅读全文
posted @ 2012-04-01 14:51
sandeepparekh9
阅读(123)
评论(0)
推荐(0)
摘要:
public static string GetLocalIP() { string _IP = null; System.Net.IPHostEntry _IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); foreach (System.Net.IPAddress _IPAddress in _IPHostEntry.AddressList) { if (_IPAd... 阅读全文
posted @ 2012-04-01 14:51
sandeepparekh9
阅读(218)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;using System.IO;using Microsoft.Win32;using System.Drawing; public sealed class clsWallpaper { const int SPI_SETDESKWALLPAPER = 20; const int SPIF_UPD... 阅读全文
posted @ 2012-04-01 14:50
sandeepparekh9
阅读(160)
评论(0)
推荐(0)
摘要:
public byte[] ReadByteArrayFromFile(string fileName) { byte[] buff = null; FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); long numBytes = new FileInfo(fileName).Length; buff =... 阅读全文
posted @ 2012-04-01 14:49
sandeepparekh9
阅读(148)
评论(0)
推荐(0)
摘要:
using System;using System.Runtime.InteropServices; /// /// This class will show or hide windows taskbar for full screen mode. /// internal class HandleTaskBar { private const int SWP_HIDEWINDOW = 0x0080; private const int SWP_SHOWWINDOW = 0x0040; /// /// Default Constructor. ... 阅读全文
posted @ 2012-04-01 14:49
sandeepparekh9
阅读(121)
评论(0)
推荐(0)
摘要:
First Add This Namespacesusing System;using System.Collections.Generic;using System.Text;using System.Security;using System.Security.Cryptography;using System.Runtime.InteropServices;using System.Text.RegularExpressions;using System.IO;using System.Windows.Forms; Now The Function: public void Decryp 阅读全文
posted @ 2012-04-01 14:44
sandeepparekh9
阅读(139)
评论(0)
推荐(0)
摘要:
First Add This Namespacesusing System;using System.Collections.Generic;using System.Text;using System.Security;using System.Security.Cryptography;using System.Runtime.InteropServices;using System.Text.RegularExpressions;using System.IO;using System.Windows.Forms; Now The Function: public void Encryp 阅读全文
posted @ 2012-04-01 14:43
sandeepparekh9
阅读(164)
评论(0)
推荐(0)
摘要:
public static object FileToObject(string _FileName) { try { // Open file for reading System.IO.FileStream _FileStream = new System.IO.FileStream(_FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); // attach file... 阅读全文
posted @ 2012-04-01 14:41
sandeepparekh9
阅读(137)
评论(0)
推荐(0)
摘要:
public static void DataTablToListView(DataTable dt, ListView lst) { for (int j = 0; j < dt.Columns.Count; j++) { lst.Columns.Add(dt.Columns[j].ColumnName); } for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i];... 阅读全文
posted @ 2012-04-01 14:40
sandeepparekh9
阅读(194)
评论(0)
推荐(0)
摘要:
public static bool ObjectToFile(object _Object, string _FileName) { try { // create new memory stream System.IO.MemoryStream _MemoryStream = new System.IO.MemoryStream(); // create new BinaryFormatter System.Run... 阅读全文
posted @ 2012-04-01 14:40
sandeepparekh9
阅读(116)
评论(0)
推荐(0)
摘要:
public static Image GetImageThumbNail(Image img,int mWidth,int mHeight) { Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback); img = img.GetThumbnailImage(mWidth , mHeight , myCallback, IntPtr.Zero); return img; } p... 阅读全文
posted @ 2012-04-01 14:39
sandeepparekh9
阅读(152)
评论(0)
推荐(0)
摘要:
public static GraphicsPath GetRoundPath(Rectangle r, int depth) { GraphicsPath graphPath = new GraphicsPath(); graphPath.AddArc(r.X, r.Y, depth, depth, 180, 90); graphPath.AddArc(r.X + r.Width - depth, r.Y, depth, depth, 270, 90); graphPath.AddArc(r.X + r.Wid... 阅读全文
posted @ 2012-04-01 14:38
sandeepparekh9
阅读(147)
评论(0)
推荐(0)
摘要:
public static string FirstLetterCapital(string strData) { string strReturn = string.Empty; strReturn = strData[0].ToString().ToUpper(); for (int i = 1; i < strData.Length; i++) { strReturn += strData[i].ToString().ToLower(); ... 阅读全文
posted @ 2012-04-01 14:37
sandeepparekh9
阅读(118)
评论(0)
推荐(0)
摘要:
public static Image byteArrayToImage(byte[] byteArrayIn) { MemoryStream ms = new MemoryStream(byteArrayIn); Image returnImage = Image.FromStream(ms); return returnImage; } 阅读全文
posted @ 2012-04-01 14:36
sandeepparekh9
阅读(132)
评论(0)
推荐(0)
摘要:
public static byte[] imageToByteArray(System.Drawing.Image imageIn){MemoryStream ms = new MemoryStream();imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);return ms.ToArray();} 阅读全文
posted @ 2012-04-01 14:33
sandeepparekh9
阅读(104)
评论(0)
推荐(0)
摘要:
public static System.Drawing.Bitmap ResizeImage(System.Drawing.Image image, int width, int height) { //a holder for the result Bitmap result = new Bitmap(width, height); //use a graphics object to draw the resized image into the bitmap using (Graphi... 阅读全文
posted @ 2012-04-01 09:48
sandeepparekh9
阅读(155)
评论(0)
推荐(0)

浙公网安备 33010602011771号