?? util.cs
字號(hào):
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;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -