2017-07-06 22:04:52 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CommonLibrary
|
|
|
|
|
|
{
|
|
|
|
|
|
public class PortraitSupport
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 小尺寸头像
|
|
|
|
|
|
/// </summary>
|
2017-07-07 10:18:28 +08:00
|
|
|
|
public const string SmallPortrait = "Size_32_.png";
|
2017-07-06 22:04:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 大尺寸头像
|
|
|
|
|
|
/// </summary>
|
2017-07-07 10:18:28 +08:00
|
|
|
|
public const string LargePortrait = "Size_300_.png";
|
2017-07-06 22:04:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static string GetSmallPortraitFileName(string dirPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] files = Directory.GetFiles(dirPath);
|
|
|
|
|
|
foreach(var m in files)
|
|
|
|
|
|
{
|
2017-07-07 10:18:28 +08:00
|
|
|
|
if(m.Contains(SmallPortrait))
|
2017-07-06 22:04:52 +08:00
|
|
|
|
{
|
|
|
|
|
|
return m;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
public static string GetLargePortraitFileName(string dirPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] files = Directory.GetFiles(dirPath);
|
|
|
|
|
|
foreach (var m in files)
|
|
|
|
|
|
{
|
2017-07-07 10:18:28 +08:00
|
|
|
|
if (m.Contains(LargePortrait))
|
2017-07-06 22:04:52 +08:00
|
|
|
|
{
|
|
|
|
|
|
return m;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|