private static int RollDiceFunc(int sendnumber)
        {
            byte[] randnumbers = new byte[1];
            RNGCryptoServiceProvider Gen = new RNGCryptoServiceProvider();

            Gen.GetBytes(randnumbers);

            int rand = Convert.ToInt32(randnumbers[0]);
            return (rand % sendnumber)+1;
        }

 

 

private string addFrontZero(string str, int len)
        {
            while (str.Length < len)
            {
                str = "0" + str;
            }
            return str;
        }

 

 

调用:

_payNO = addFrontZero(CustomerId.ToString(), 7) + "9" + DateTime.Now.ToString("yyMMddHHmmss");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2022-12-23
  • 2021-08-29
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案