首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C#
using System;

class Program
{
    static void Swap(ref int a, ref int b)
    {
        int temp = a;
        a = b;
        b = temp;
    }

    static void Main(string[] args)
......................
阅读全部 | 张晓彤 贴于 2024年5月3日 19:39     hide bbsi
using System;

class Program
{
    static void Swap(ref int a, ref int b)
    {
        int temp = a;
        a = b;
        b = temp;
    }

    static void Main(string[] args)
......................
阅读全部 | 张晓彤 贴于 2024年5月3日 19:38     hide bbsi
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UdpClientServer
{
    class class1
    {
        static void Main()
        {
            StarListener();
            Console.ReadLine();
......................
阅读全部 | weiwei2023 贴于 2023年4月12日 13:04     hide bbsi
public   void EnableDHCP()
        {

            string ethernetDescription = "{5F632379-D5A7-4F26-89FC-C172212EDF65}";
            ManagementClass wmi = new ManagementClass("Win32_NetworkAdapterConfiguration");
            ManagementObjectCollection moc = wmi.GetInstances();
            foreach (ManagementObject mo in moc)
            {
                //如果没有启用IP设置的网络设备则跳过
                /* if (!(bool)mo["IPEnabled"])
                       continue;*/
                string settingID = mo["SettingID"].ToString();
......................
阅读全部 | 巴厘岛 贴于 2022年12月1日 16:40     hide bbsi
using N1;
namespace Test02
{
    class program
    {
        static void Main(string[] args)
        {
            A oa=new A();
            oa.Myls();
        }
        
    }
......................
阅读全部 | caiji1 贴于 2021年8月22日 08:28     hide bbsi
using System;
using System.IO;code_br_code_br_namespace FileApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                // 创建一个 StreamReader 的实例来读取文件 
                // using 语句也能关闭 StreamReader
                using (StreamReader sr = new StreamReader("names.txt"))
......................
阅读全部 | Xyk87 贴于 2021年4月29日 21:05     hide bbsi
using System;
using System.IO;code_br_code_br_namespace FileApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                // 创建一个 StreamReader 的实例来读取文件 
                // using 语句也能关闭 StreamReader
                using (StreamReader sr = new StreamReader("names.txt"))
......................
阅读全部 | Xyk87 贴于 2021年4月29日 21:04     hide bbsi
Option Explicit
Private Const WS_CHILD = &H40000000
Private Const WS_VISIBLE = &H10000000
Private Const LVS_REPORT = &H1
Private Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Type LVCOLUMN
    Mask        As Long
    Fmt         As Long
    cX          As Long
    pszText     As String
......................
阅读全部 | LHY163311 贴于 2020年12月3日 18:54     hide bbsi
Option Explicit
Private Const WS_CHILD = &H40000000
Private Const WS_VISIBLE = &H10000000
Private Const LVS_REPORT = &H1
Private Declare Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Type LVCOLUMN
    Mask        As Long
    Fmt         As Long
    cX          As Long
    pszText     As String
......................
阅读全部 | LHY163311 贴于 2020年12月3日 18:54     hide bbsi
//辅助自定义代码生成器用
public void READSB()
        {

            string dir = AppDomain.CurrentDomain.BaseDirectory;
            dir = dir + "READ\\";
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            string file = dir + "a.txt";
            string file2 = dir + "b.txt";
......................
阅读全部 | miaoge911015 贴于 2020年9月23日 18:30     hide bbsi
1 2 3 4 5 6 7 8 9 下一页