⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.cs

📁 移动MISC1.6正向、反向定制、取消接口
💻 CS
字号:
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;


    public class Util
    {
        public static string Get_MMDDHHMMSS_String(DateTime dt)
        {
            string s = dt.Month.ToString().PadLeft(2,'0');
            s+= dt.Day.ToString().PadLeft(2,'0');
            s+= dt.Hour.ToString().PadLeft(2,'0');
            s+= dt.Minute.ToString().PadLeft(2,'0');
            s += dt.Second.ToString().PadLeft(2,'0');
            return s;
        }

        public static string Get_YYYYMMDD_String(DateTime dt)
        {
            string s = dt.Year.ToString().PadLeft(4,'0');
            s+=dt.Month.ToString().PadLeft(2,'0');
            s+=dt.Day.ToString().PadLeft(2,'0');
            return s;
        }

        internal static void WriteToStream(byte[] bytes, NetworkStream Stream)
        {
            if (Stream.CanWrite)
            {
                //lock(_SyncLockObject)
                {
                    Stream.Write(bytes, 0, bytes.Length);
                }
            }
        }
        internal static byte[] ReadFromStream(int Length, NetworkStream Stream)
        {
            byte[] bytes = null;
            if (Stream.CanRead)
            {
                if (Stream.DataAvailable)
                {
                    bytes = new byte[Length];
                    int r = 0;
                    int l = 0;
                    //lock(_SyncLockObject)
                    {
                        while (l < Length)
                        {
                            r = Stream.Read(bytes, l, Length - l);
                            l+= r;
                        }
                    }
                }
            }
            return bytes;
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -