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
Ïà¹ØÎĵµ£º
MSSQL:
declare @begin datetime
declare @End datetime
set @begin=getdate()
--Ö´ÐеÄÓï¾äдÔÚÕâÀï
set @End=getdate()
select datediff(millisecond,@begin,@End) as Ö´ÐеÄʱ¼ä
--millisecond±íʾºÁÃë Èç¹û¿´Ãë¿ÉÒÔʹÓÃss
C#:
ºÜ¶àʱº ......
£¨Ò»£©°ÑÎļþÄÚÈÝдÈëAccessÊý¾Ý¿âµÄOLE¶ÔÏó×Ö¶ÎÖУº
if (File.Exists(txtBrow.Text) != false) // Îı¾¿òtxtBrowÖÐÄÚÈÝΪÎļþ·¾¶¼°ÎļþÃû
{
//»ñÈ¡Îļþºó׺
FileInfo p = new FileInfo(txtBrow.Text.Trim());
F_str_Type = ......
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
¡¡¡¡´ó¼ÒÔÚʵ¼Ê¹¤×÷ѧϰC#µÄʱºò£¬¿ÉÄÜ»áÎÊ£ºÎªÊ²Ã´ÎÒÃÇҪΪһЩÒѾ´æÔڵŦÄÜ£¨±ÈÈçWindowsÖеÄһЩ¹¦ÄÜ£¬C++ÖÐÒѾ±àдºÃµÄһЩ·½·¨£©ÒªÖØÐ±àд´úÂ룬C#ÓÐûÓз½·¨¿ÉÒÔÖ±½Ó¶¼ÓÃÕâЩԱ¾ÒѾ´æÔڵŦÄÜÄØ£¿´ð°¸Êǿ϶¨µÄ£¬´ó¼Ò¿ÉÒÔͨ¹ýC#ÖеÄDllImportÖ±½Óµ÷ÓÃÕâЩ¹¦ÄÜ¡£
¡¡¡¡DllImportËùÔÚµÄÃû×Ö¿Õ¼ä using System.Runt ......
//ÃüÃû¿Õ¼ä using Microsoft.Win32;
private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
{
if (checkBox2.Checked) //ÉèÖÿª»ú×ÔÆô¶¯
{
//MessageBox.Show ("ÉèÖÿª»ú×ÔÆô¶¯ÐèÒªÐÞ¸Ä×¢²á±í","Ìáʾ");
string path = Application.ExecutablePath;
RegistryKey rk = Registry.LocalMac ......