IDE0008-显式类型

This commit is contained in:
YFdyh000
2020-03-15 03:25:40 +08:00
parent 56c3c22568
commit 67b99c4c8b
24 changed files with 131 additions and 131 deletions
+14 -14
View File
@@ -39,7 +39,7 @@ namespace v2rayN
try
{
var assembly = Assembly.GetExecutingAssembly();
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream(res))
using (StreamReader reader = new StreamReader(stream))
{
@@ -194,7 +194,7 @@ namespace v2rayN
{
try
{
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
byte[] plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
return Convert.ToBase64String(plainTextBytes);
}
catch (Exception ex)
@@ -272,20 +272,20 @@ namespace v2rayN
/// <param name="unit">单位</param>
public static void ToHumanReadable(ulong amount, out double result, out string unit)
{
var factor = 1024u;
var KBs = amount / factor;
uint factor = 1024u;
ulong KBs = amount / factor;
if (KBs > 0)
{
// multi KB
var MBs = KBs / factor;
ulong MBs = KBs / factor;
if (MBs > 0)
{
// multi MB
var GBs = MBs / factor;
ulong GBs = MBs / factor;
if (GBs > 0)
{
// multi GB
var TBs = GBs / factor;
ulong TBs = GBs / factor;
if (TBs > 0)
{
// 你是魔鬼吗? 用这么多流量
@@ -322,7 +322,7 @@ namespace v2rayN
public static void DedupServerList(List<Mode.VmessItem> source, out List<Mode.VmessItem> result, bool keepOlder)
{
var list = new List<Mode.VmessItem>();
List<Mode.VmessItem> list = new List<Mode.VmessItem>();
if (!keepOlder) source.Reverse(); // Remove the early items first
bool _isAdded(Mode.VmessItem o, Mode.VmessItem n)
@@ -341,7 +341,7 @@ namespace v2rayN
o.streamSecurity == n.streamSecurity;
// skip (will remove) different remarks
}
foreach (var item in source)
foreach (Mode.VmessItem item in source)
{
if (!list.Exists(i => _isAdded(i, item)))
{
@@ -410,7 +410,7 @@ namespace v2rayN
//可能是CIDR
if (ip.IndexOf(@"/") > 0)
{
var cidr = ip.Split('/');
string[] cidr = ip.Split('/');
if (cidr.Length == 2)
{
if (!IsNumberic(cidr[0]))
@@ -515,7 +515,7 @@ namespace v2rayN
{
try
{
var value = RegReadValue(autoRunRegPath, autoRunName, "");
string value = RegReadValue(autoRunRegPath, autoRunName, "");
string exePath = GetExePath();
if (value?.Equals(exePath) == true)
{
@@ -917,10 +917,10 @@ namespace v2rayN
GraphicsUnit.Pixel);
}
var source = new BitmapLuminanceSource(target);
var bitmap = new BinaryBitmap(new HybridBinarizer(source));
BitmapLuminanceSource source = new BitmapLuminanceSource(target);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
QRCodeReader reader = new QRCodeReader();
var result = reader.decode(bitmap);
Result result = reader.decode(bitmap);
if (result != null)
{
ret = result.Text;