常见算法C#描述
冒泡排序
using System;
class Program
{
public static void Main()
{
int[] a = new int[10];
Random rand = new Random();
for (int i = 0; i < 10; i++)
{
a[i] = rand.Next(10);//生成随机数给数组赋值
}
for (int i = 0; i < 10; i++)
{
Console.Write(a[i]);
}
for(int i=0;i<9;i++)
for (int j = i + 1; j < 10; j++)
{
int temp = 0;
if (a[i] > a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
Console.WriteLine();
for (int i = 0; i < 10; i++)
Console.Write(a[i]);
Console.Read();
}
}
相关文档:
1.添加命名空间引用
using System.Xml;
2.新建xml实例
public XmlDocument objXmlDoc = new XmlDocument();
3.加载Xml文档
string path=Server.Mappath("demo.xml");//得到文档路径
objXmlDoc.Load(path);//加载文档
4.查找要进行操作的结点
objXmlDoc.SelectNodes(xpath);//得到结点集合
objXmlDoc.SelectSingleN ......
1 父类 partial class FormBillTemplet:Form
/// <summary>
/// 新单
/// </summary>
/// <param name="s ......
http://blog.csdn.net/carl2380/archive/2009/11/18/4826973.aspx
简介:
本文着重讲述了如果用WM_COPYDATA消息来实现两个进程之间传递数据.
进程之间通讯的几种方法:
在Windows程序中,各个进程之间常常需要交换数据,进行数据通讯。常用的方法有
使用内存映射文件
通过共享内存DLL共享内存
使 ......
1、引用的空间:
using System.DirectoryServices;
using System.ServiceProcess;
2、调用
private void button1_Click(object sender, EventArgs e)
{
String webSiteName = "默认网站";
String pathToRoot = @"C:\Inetpub\wwwroot";
CreateWebSite(webSit ......