C#µÝ¹éʵÏÖTreeview
ÎÞÒâ·¢ÏÖÔÚÍøÉϺܸÕѧC#µÄÅóÓÑÃǶ¼ÔÚÕÒ¹ØÓÚC#ÈçºÎµÝ¹éʵÏÖTreeViewµÄ°ó¶¨£¬¼ûÍøÉϺܶàÀý×Ó¶¼±È½ÏÉî°Â£¬ÎÒÌØÒâдÁ˸ö±È½Ï¼òµ¥Ò×¶®µÄÀý×Ó°ïÖú´ó¼ÒÁ˽âC#TreeViewµÄ²Ù×÷ÓëµÝ¹éµÄʵÏÖ...
±¾ÎÄÖ»ÊÇÓõݹéµÄ·½Ê½¼òµ¥ÊµÏÖTreeViewµÄ²Ù×÷£¬¿ÉÄÜ´æÔÚÐÔÄÜÉϵÄÎÊÌ⣬½ö¹©³õѧÕ߲ο¼¡£
Ч¹ûͼ£º
Ò»£º´´½¨Êý¾Ý¿âºÍÊý¾Ý±í£¨Area£©
¶þ£º´´½¨AreaManageÏîÄ¿£º
ÏîÄ¿½á¹¹£º
ÒÔÏÂÊǸ÷¸öÀàÎļþµÄ´úÂ룺
1.SQLOperate.cs
/// <summary>
///SQLOperate µÄժҪ˵Ã÷
/// </summary>
public class SQLOperate
{
/// <summary>
/// ¸ù¾ÝparentId²éµØÇøÐÅÏ¢
/// </summary>
/// <param name="parentId"></param>
/// <returns></returns>
public static DataTable GetAreaInfoByParentId(int parentId)
{
string sql = "select * from Area where ParentId = @ParentId";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@ParentId",parentId)
};
return DBHelper.GetDataSet(sql, para);
}
/// <summary>
/// ¸ù¾ÝID²éÕÒµØÇø
/// </summary>
/// <param name="areaId"></param>
/// <returns></returns>
public static DataTable GetAreaInfoById(int areaId)
{
string sql = "select * from Area where AreaId = @AreaId";
SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Areaid",areaId)};
return DBHelper.GetDataSet(sql, para);
}
/// <summary>
/// Ôö¼Óͬһ¼¶µØÇø
/// </summary>
/// <param name="parentId"></param>
/// <param name="areaName"></param>
/// <returns></returns>
public static int AddParityClass( int parentId,string areaName)
{
string sql = "insert into Area(AreaName,ParentId)values(@AreaName,@ParentId)";
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@AreaName",areaName),
new SqlParameter("@ParentId",parentId)
};
Ïà¹ØÎĵµ£º
´ÓContainerControlÀà¼Ì³ÐµÄ×ÓÀà×÷ΪÈÝÆ÷´°Ì壬¿ÉÒÔÈÝÄɳýFormÀà¶ÔÏóÍâµÄÆäÓà´°Ìå¶ÔÏó¡£
ÔÚËùÓÐÈÝÆ÷´°ÌåÄÚ£¬×î»ù±¾µÄ¾ÍÊǶ¥¼¶ÈÝÆ÷FormÀàÒÔ¼°Ãæ°åÈÝÆ÷PanelÀà¡£ÕâÁ½ÕßµÄÖ÷񻂿±ðΪ£ºÇ°Õß¾ßÓÐWindows±ê×¼¿ò¼Ü£¨±êÌâÀ¸£¬×î´ó»¯¡¢×îС»¯ºÍ¹Ø±Õ°´Å¥£¬´°Ìå±ß¿ò£¬¿Éµ÷Õû³ß´ç£©£¬²¢ÇÒ¿ÉÒÔ¶ÀÁ¢´æÔÚ£»ºóÕßÖ»ÊÇÒ»¿éÇøÓò£¬²¢ÇÒ±ØÐëÒÀ¸½ ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ½«Ã¶¾Ù×÷Ϊ¼üÖµµÄÐÎʽ´æ´¢
{
enum Myenum
{
First=3,
Second ......
¡¾ÆªÊ×Óï¡¿Æäʵ±¾ÎĽéÉܵķ½·¨ÊÇÒ»¸ö˼·£¬µ«ÊÇÎҸоõ°ÉÎÊÌâ¸ã¸´ÔÓÁË¡£ÀÏÍâµÄÕâ¸öC#µ÷ÓÃC++µÄdll·½Ê½Í¦ºÃµÄ£¬Ò²ºÜÎȶ¨£¬¿ÉÒÔ¿´¿´http://www.codeproject.com/KB/cs/DynamicInvokeCSharp.aspx¡£
Õª Òª£ºÔÚ¡¶csdn¿ª·¢¸ßÊÖ¡·2004ÄêµÚ03ÆÚÖеġ¶»¯¹¦´ó·¨ ——½«DLLǶÈëEXE¡·Ò»ÎÄ£¬½éÉÜÁËÈçºÎ°ÑÒ»¸ö¶¯Ì¬Á´½Ó¿â×÷Ϊһ¸ ......
ÍêÉÆÁË“ÈçºÎÔÚC#ÖÐʹÓÃWin32ºÍÆäËû¿â”ÖйØÓÚEnumDesktops()º¯ÊýµÄ»Øµ÷´úÂ룬¿ÉÔËÐС£
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
delegate bool EnumDesk ......
ÒÔÏÂÊÇÒ»¸ö²éѯIPµØÖ·¹éÊôµØµÄCLR´æ´¢¹ý³Ì£¬Èý²½£º
1¡¢ÓÃC#À´×öDLL£¬´úÂëÈçÏ£º
//====================================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using Microsoft.Sq ......