Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#×Ô¶¯¹Ø»úÔ´Âë

Ô´ÂëÈçÏ£º
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Win32;
namespace mv
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Çëµã»÷È·¶¨¼ü¹Ø»ú(µãÈ·¶¨Ï´οª»ú×Ô¶¯¹Ø»ú£¬µãÈ¡ÏûÏ´β»ÔËÐÐ)", "info", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            if (result == DialogResult.Yes)
            {
                string path = System.Windows.Forms.Application.ExecutablePath;
                int ab=path.Length;
                int a = path.LastIndexOf(@"\");
                int b = path.LastIndexOf(".");
                string mess = path.Substring(a+1, b - a - 1);
                MessageBox.Show(mess);
      &nb


Ïà¹ØÎĵµ£º

ÈçºÎ¼ÆËãMS SQLÓï¾äÖ´ÐеÄʱ¼ä»¹ÓÐc#


MSSQL:
declare @begin datetime
declare @End datetime
set @begin=getdate()
   --Ö´ÐеÄÓï¾äдÔÚÕâÀï
set @End=getdate()
select datediff(millisecond,@begin,@End) as Ö´ÐеÄʱ¼ä
--millisecond±íʾºÁÃë Èç¹û¿´Ãë¿ÉÒÔʹÓÃss
C#:
ºÜ¶àʱº ......

C#ÖÐʹÓÃDataTableÏÔʾAccessÊý¾Ý¿âÖÐÎļþÁбí


private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
             this.comboBox2.Items.Clear();
            switch(this.comboBox1.SelectedIndex)
       ......

c#xmlµÄÔöɾ¸Ä²é


ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º  
  <?xml   version="1.0"   encoding="gb2312"?>  
  <bookstore>  
      <book   genre="fantasy"   ISBN="2-3631-4">  
       &n ......

ÓÃC#´´½¨XML[¼òµ¥´úÂë]

XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......

c#²Ù×÷Excel һЩÎÊÌâ ×Ö·û±äΪnull½â¾ö·½·¨


C#¶ÁÈ¡ExcelÓöµ½ÎÞ·¨¶ÁÈ¡µÄ½â¾ö·½·¨£º
1.ÔÚµ¼ÈëÊý¾ÝÁ¬½Ó×Ö·û´®ÖУ¬½«IMEX=1¼ÓÈ룬“Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Data.xls";Extended Properties="Excel 8.0;HDR=Yes;IMEX=1; ”£¬ÕâÑù¾Í¿ÉÒÔ¡£
C#¶ÁÈ¡ExcelÐèҪעÒâµÄ£º
IMEX=1£º»ìºÏģʽ
HDR=Yes; ÊÇ·ñÈõÚÒ»ÐÐ×÷ΪÁÐÍ·
Á½Õß±ØÐëÒ»Æ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ