1拼多多接口上传及相关功能(不含部分功能) 2拼多多选品
This commit is contained in:
1 parent
ff42506091
commit
07b912e9eb
37 files changed
+21117
-206
No files matched your search
@@ -750,6 +750,61 @@ namespace AllBase
|
||||
{
|
||||
return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
|
||||
}
|
||||
|
||||
private static char[] constant =
|
||||
{
|
||||
'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'
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 随机返回指定位数的字母数字组合
|
||||
/// </summary>
|
||||
/// <param name="iLength"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetRandomAlphanumeric(int iLength)
|
||||
{
|
||||
System.Text.StringBuilder newRandom = new System.Text.StringBuilder(62);
|
||||
for (int i = 0; i < iLength; i++)
|
||||
{
|
||||
newRandom.Append(constant[Randomx.GetId(62)]);
|
||||
}
|
||||
return newRandom.ToString();
|
||||
}
|
||||
|
||||
public static long ConvertDateTimeLong(DateTime time)
|
||||
{
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
|
||||
return (long)(time - startTime).TotalMilliseconds;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取Unix毫秒级时间戳
|
||||
/// </summary>
|
||||
/// <returns>当前时间戳</returns>
|
||||
public static long ConvertDateTimeLong()
|
||||
{
|
||||
return (GetServerTimeString().ToUniversalTime().Ticks - 621355968000000000) / 10000;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取两个标题相似度
|
||||
/// </summary>
|
||||
/// <param name="refererTitle">参照标题</param>
|
||||
/// <param name="checkTitle">检测标题</param>
|
||||
/// <returns>相似度</returns>
|
||||
public static double GetSimularityBetween2Text(string refererTitle, string checkTitle)
|
||||
{
|
||||
double sameCnt = 0;
|
||||
for (int i = 0; i < refererTitle.Length; i++)
|
||||
{
|
||||
if (checkTitle.IndexOf(refererTitle.Substring(i, 1)) != -1)
|
||||
{
|
||||
sameCnt += 1;
|
||||
}
|
||||
}
|
||||
return Math.Round(sameCnt / Convert.ToDouble(refererTitle.Length), 2);
|
||||
}
|
||||
}
|
||||
|
||||
public class KeyValueBase
|
||||
|
||||
Reference in new issue
Block a user