[Serializable]
public class PrizeDetail:ICloneable
{
public string Id { get; set; }
/// <summary>
/// 奖品名称
/// </summary>
public string PrizeName { get; set; }
/// <summary>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Internal; | |
using Microsoft.IO; | |
// https://exceptionnotfound.net/using-middleware-to-log-requests-and-responses-in-asp-net-core/ | |
// https://gist.github.com/elanderson/c50b2107de8ee2ed856353dfed9168a2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=========================== Filebeat inputs ============================= | |
filebeat.inputs: | |
- type: log | |
enabled: true | |
fields: | |
_recharge_api: true | |
paths: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
private const string VCHAR = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"; | |
private const string VNUM = "0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9"; | |
public static void Main() | |
{ | |
Console.WriteLine(RndNum(16)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.IO; | |
namespace ConsoleApp | |
{ | |
// 将 UTF-8 Bom 转换为 UTF-8 的几种方法 | |
class Program | |
{ |
利用 transform Configuration, 用来解决不同环境(如开发、生产环境)使用不同配置的情况, 只需切换
Debug
、Release
或其它自定义配置, 最终生成相应的配置文件.
目录结构:
| App_Config
| Web.Base.config
| Web.Debug.config
| Web.Release.config
using System.IO;
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
// output : C:\Users\robin
string myDocuments = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
// output : C:\Users\robin\Documents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static long ToInt(string addr) | |
{ | |
// careful of sign extension: convert to uint first; | |
// unsigned NetworkToHostOrder ought to be provided. | |
return (long) (uint) IPAddress.NetworkToHostOrder( | |
(int) IPAddress.Parse(addr).Address); | |
} | |
static string ToAddr(long address) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
StringBuilder builder = new StringBuilder(); | |
// ASCII 中, 65表示A, 90表示Z | |
for(int i = 65; i<=90; i++) | |
{ | |
builder.Append((char)i); | |
} |
NewerOlder