C#远程重启计算机 2006-2-11 0 · 首先添加对 System.Management的引用 然后代码入下: ConnectionOptions op = new ConnectionOptions ( ) ; op.Username ="wgscd";’或者你的帐号(注意要有管理员的权限) op.Password = "wgscd" ; ’你的密码 ManagementScope scope = new ManagementScope( "...
在.NET开发中灵活使用TreeView控件 2006-2-11 0 · ASP.NET真正有用的特性就是其可扩充性。世界各地的开发人员都可以创建自己的自定义控件,这种自定义控件可以方便地在你自己的过程中进行定义。其中,Internet Explorer Web Controls就是由微软公司在标准的ASP.NET控件之外创建的这样一个集合。 Windows资源管理器中的驱动器和其下的文件及文件 ...
亲密接触ADO.NETv2.0 2006-2-11 0 · 随Whidbey发布的新一代ADO.NET有一些伟大的特征,这将使我们开发人员的生活变得更轻松一点点。下面我向大家介绍ADO.NETv2.0的一些特征。一.多活动结果集(MARS:Multiple Active Results Sets)允许一个连接支持多个并发命令和多个打开的结果集。你能通过一个查询打开一个结果集,并且在前一个仍 ...
.NET泛型技巧之打造可复用的抽象工厂 2006-1-17 0 · 泛型不仅能用来做容器,还能够提供代码复用的手段。在泛型的参与下,许多设计就可能更精妙,更具扩展性。今天我就来演示一个利用泛型增强的抽象工厂模式。我们知道,抽象工厂(Abstract Factory)模式是将工厂和产品全部抽象化,一个抽象工厂生成一组抽象产品,而一个具体工厂则生成具体产品的一个...
My AbstractFactory in C# 2006-1-13 0 · //MyAbstractFactory
using System;///////////////Basic Products////////////////
//AbstractProducts
abstract class FontsStyle
{public string stylestring;
};abstract class TablesStyle
{public string stylestring;
};
//RealProducts
class FontsStyleA:FontsStyle
{public FontsStyle...
My Builder in C# 2006-1-13 0 · //MyBuilder
using System;
using System.Collections;///////////////////////product///////////////////////
class HomePage
{//Fieldsprivate string pagetype;private string samplecode;private Hashtable parts=new Hashtable(); //Construcrorspublic HomePage(string pagetype){this.pag...
c#范型体验1 2006-1-13 0 · 写了点代码,初次体验到C#范型的魅力class Program{static void WriteSometing<T>(T x,T y){if (typeof(T) == typeof(int))Console.WriteLine(x);if (typeof(T) == typeof(string))Console.WriteLine(y);}static void Main(string[] args){WriteSometing<int>(0, 9);WriteSometing<...
My Singleton in C# 2006-1-13 0 · //MySingleton
using System;
//SingletonPage Class
class SingletonPage
{//Fields protected static SingletonPage checkoutpage;//Constructor is protected to ensure Singletonprotected SingletonPage(){Console.WriteLine("if you see this line,then the only one instence is creat...
My Prototype in C# 2006-1-13 0 · //MyPrototype
using System;
using System.Collections;
//abstract PageStylePrototype Class 'Prototype
abstract class PageStylePrototype
{ //Fieldsprotected string stylestring;//Propertiespublic string StyleString{get{return stylestring;}set{stylestring=value;}}//Methodsabstr...
My FactoryMethod in C# 2006-1-13 0 · //MyFactoryMethod
using System;
using System.Collections;
//SinglePage class,which build the at last product,part element
//----top class
abstract class SinglePage
{
};
//----element1
class RegisterPage:SinglePage
{
};
//----element2
class LoginPage:SinglePage
{
};
//----elem...
使用C#在应用程序间发送消息 2006-1-13 0 · 用C#在应用程序间发送消息作者:kongxx首先建立两个C#应用程序项目。第一个项目包含一个Windows Form(Form1),在Form1上有一个Button和一个TextBox。第二个项目包含一个Windows Form(Form1),在Form1上有两个Button,分别用来测试第一个应用程序中Button的Click事件和修改第一个应用程序中TextBox的 ...
C#.Net网络程序开发-Tcp篇 2006-1-13 1 · 前一篇《Visual C#.Net网络程序开发-Socket篇》中说到:支持Http、Tcp和Udp的类组成了TCP/IP三层模型(请求响应层、应用协议层、传输层)的中间层-应用协议层,该层的类比位于最底层的Socket类提供了更高层次的抽象,它们封装 TCP 和 UDP 套接字的创建,不需要处理连接的细节,这使得我们在编写套接 ...
C#命名规则和开发习惯 2006-1-13 0 · C# Coding Standard一、命名1.用pascal规则来命名方法和类型.public class TextBox{public void DataBind() {}}2.用camel规则来命名局部变量和方法的参数.string userName;public AddUser(string userId, byte[] password);3.所有的成员变量前加前缀 m_public class Database{public string m_con...
磁盘配额的wmi版本(C#) 2006-1-13 0 · using System;using System.Management;namespace DiskQuota{/// <summary>/// Class1 的摘要说明。/// </summary>class Class1{/// <summary>/// 应用程序的主入口点。/// </summary>[STAThread]static void Main(string[] args){try{ManagementClass c = new Management...
学C#遇到的几个问题 2006-1-13 0 · 1,不晓得为什么,安装的Visual studio好像不完全似的,书上提到某些数据类型的某些方法居然没有!
比如: int myNumber = Int32.FromString(s);
报错:F:My DocumentsVisual Studio Projectsexam3_5Class1.cs(28): “int”并不包含对“FromString”的定义
(该问题已解决:改成 int myNumber = I...
使用C#进行SMTP协议客户端开发心得--读取服... 2006-1-13 0 · 以TcpClient连接方式为例,首先取得服务器发回的数据流。NetworkStream streamAccount=tcpClient.GetStream();当我们对smtp服务器发送请求,例如连接,传送用户名,密码后,服务器会返回应答数据流。我们必须对服务器返回数据流进行读取,这一步我经历了3次改动。最开始的程序是按照《Visaul C#.NE...
用Visual C#实现文件下载功能 2006-1-13 0 · 一.概述: 本文通过一个实例向大家介绍用Visual C#进行Internet通讯编程的一些基本知识。我们知道.Net类包含了请求/响应层、应用协议层、传输层等层次。在本程序中,我们运用了位于请求/响应层的WebRequest类以及WebClient类等来实现高抽象程度的Internet通讯服务。本程序的功能是完成网络文件的 ...
C#农历 2006-1-13 0 · using System; namespace CNCalendar { public class CNDate { private const ushort START_YEAR = 1901; private const ushort END_YEAR = 2050; private string[] ConstellationName = { "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", ...
c#如何读INI文件中的设置信息 2006-1-13 1 · 把下面的代码改动一下,就可以在你的程序中使用,当然
别忘记加上名字空间哦。
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;namespace Sx_Mdi
{/// <summary>
/// Summary description for Class1.
/// </summary>
public class IniFile...
C#读硬盘序列号的原代码 2006-1-13 0 · public class IDE
{
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
internal struct IDSECTOR
{
public ushort wGenConfig;
public ushort wNumCyls;
public ushort wReserved;
public ushort wNumHeads;
public ushort wBytesPerTrack;
public ushort wBytesPerSector;...
页次:14 /228 20篇/页 首页 上一页 下一页 尾页 合计 4553 篇 Go:第1页 第2页 第3页 第4页 第5页 第6页 第7页 第8页 第9页 第10页 第11页 第12页 第13页 第14页 第15页 第16页 第17页 第18页 第19页 第20页 第21页 第22页 第23页 第24页 第25页 第26页 第27页 第28页 第29页 第30页 第31页 第32页 第33页 第34页 第35页 第36页 第37页 第38页 第39页 第40页 第41页 第42页 第43页 第44页 第45页 第46页 第47页 第48页 第49页 第50页 第51页 第52页 第53页 第54页 第55页 第56页 第57页 第58页 第59页 第60页 第61页 第62页 第63页 第64页 第65页 第66页 第67页 第68页 第69页 第70页 第71页 第72页 第73页 第74页 第75页 第76页 第77页 第78页 第79页 第80页 第81页 第82页 第83页 第84页 第85页 第86页 第87页 第88页 第89页 第90页 第91页 第92页 第93页 第94页 第95页 第96页 第97页 第98页 第99页 第100页 第101页 第102页 第103页 第104页 第105页 第106页 第107页 第108页 第109页 第110页 第111页 第112页 第113页 第114页 第115页 第116页 第117页 第118页 第119页 第120页 第121页 第122页 第123页 第124页 第125页 第126页 第127页 第128页 第129页 第130页 第131页 第132页 第133页 第134页 第135页 第136页 第137页 第138页 第139页 第140页 第141页 第142页 第143页 第144页 第145页 第146页 第147页 第148页 第149页 第150页 第151页 第152页 第153页 第154页 第155页 第156页 第157页 第158页 第159页 第160页 第161页 第162页 第163页 第164页 第165页 第166页 第167页 第168页 第169页 第170页 第171页 第172页 第173页 第174页 第175页 第176页 第177页 第178页 第179页 第180页 第181页 第182页 第183页 第184页 第185页 第186页 第187页 第188页 第189页 第190页 第191页 第192页 第193页 第194页 第195页 第196页 第197页 第198页 第199页 第200页 第201页 第202页 第203页 第204页 第205页 第206页 第207页 第208页 第209页 第210页 第211页 第212页 第213页 第214页 第215页 第216页 第217页 第218页 第219页 第220页 第221页 第222页 第223页 第224页 第225页 第226页 第227页 第228页