C#
爱尚游Bin
Unity Developer
展开
-
C# 过滤非法字符的方法
public static string GetSafeValue(string value) { if ( string.IsNullOrEmpty(value) ) return string.Empty; value = Regex.Replace(value, @";", string.Emp...原创 2019-10-23 15:45:14 · 1104 阅读 · 0 评论 -
C# DateTime时间格式转换为Unix时间戳格式
// DateTime时间格式转换为Unix时间戳格式 public static int DateTimeToStamp(System.DateTime time) { System.DateTime startTime = System.TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970,...原创 2019-01-24 17:25:56 · 1063 阅读 · 0 评论 -
C# 常用方法锦集
获取本机Mac地址 /// <summary> /// 获取本机Mac地址(物理地址) /// </summary> public static string GetLocalMac() { string Mac=""; try ...原创 2019-01-22 15:16:53 · 224 阅读 · 0 评论 -
C# 判断输入的字符串内容是否符合ip地址格式
private bool JudgeIPFormat(string strJudgeString) { bool blnTest = false; bool _Result = true; Regex regex = new Regex("^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$"); ...原创 2019-05-10 17:05:47 · 2368 阅读 · 0 评论 -
C# Socket异步通讯_客户端
using System;using System.Net;using System.Net.Sockets;using System.Text;namespace SocketTest{ public class AsynSocket_Client { public static Socket client; public static...原创 2019-05-24 10:42:15 · 1182 阅读 · 0 评论 -
C# Socket异步通讯_服务端
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading.Tasks;namespace AsyncServer{ class Progr...原创 2019-06-04 13:59:43 · 523 阅读 · 0 评论 -
C# 几种常用排序方法示例
/// <summary> /// 冒泡排序 /// </summary> static void BubbleSort() { int[] array = { 5, 2, 7, 4, 8, 9, 1, 3, 6 }; int count = 0; ...原创 2019-09-06 17:47:59 · 182 阅读 · 0 评论