Files
SecMPS/api_sqlsugar/Warehouse/Services/ReadDBTableName/Partial/ReadDBTableNameService.cs
2026-05-15 23:22:48 +08:00

772 lines
35 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
*所有关于ReadDBTableName类的业务代码应在此处编写
*可使用repository.调用常用方法获取EF/Dapper等信息
*如果需要事务请使用repository.DbContextBeginTransaction
*也可使用DBServerProvider.手动获取数据库相关信息
*用户信息、权限、角色等使用UserContext.Current操作
*ReadDBTableNameService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
*/
using System;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using VolPro.Core.BaseProvider;
using VolPro.Core.Extensions;
using VolPro.Core.Extensions.AutofacManager;
using VolPro.Core.Utilities;
using VolPro.Entity.DomainModels;
using Warehouse.IRepositories;
namespace Warehouse.Services
{
public partial class ReadDBTableNameService
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IReadDBTableNameRepository _repository;//访问数据库
[ActivatorUtilitiesConstructor]
public ReadDBTableNameService(
IReadDBTableNameRepository dbRepository,
IHttpContextAccessor httpContextAccessor
)
: base(dbRepository)
{
_httpContextAccessor = httpContextAccessor;
_repository = dbRepository;
//多租户会用到这init代码其他情况可以不用
//base.Init(dbRepository);
}
public string GetAlertMessage()
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "库房31_烟感报警01检测到烟雾浓度超标<br />请在右侧视频窗口中查看此处实时画面。";
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "库房31_温度01检测到温度超标<br />请在右侧视频窗口中查看此处实时画面。<br />已经开启01号空调。";
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "库房31_湿度01检测到湿度超标<br />请在右侧视频窗口中查看此处实时画面。<br />已经开启01号除湿机。";
}
}
}
}
return "无";
}
#region
public string GetFirstVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=15&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=15&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=15&iframeid=" + iframeid;
}
}
}
}
return GetFirstRandomAddress() + "&iframeid=" + iframeid;
}
public string GetSecondVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetSecondRandomAddress() + "&iframeid=" + iframeid;
}
public string GetThirdVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetThirdRandomAddress() + "&iframeid=" + iframeid;
}
public string GetFourthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetFourthRandomAddress() + "&iframeid=" + iframeid;
}
public string GetFifthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetFifthRandomAddress() + "&iframeid=" + iframeid;
}
public string GetSixthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetSixthRandomAddress() + "&iframeid=" + iframeid;
}
public string GetSeventhVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetSeventhRandomAddress() + "&iframeid=" + iframeid;
}
public string GetEighthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetEighthRandomAddress() + "&iframeid=" + iframeid;
}
public string GetNinthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetNinthRandomAddress() + "&iframeid=" + iframeid;
}
public string GetTenthVideoAddress(string iframeid = "gljsv01")
{
var data = _repository.FindFirst(x => x.Name == "库房31_烟感报警01");
if (data != null)
{
if (data.Value == "1")
{
return "http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
data = _repository.FindFirst(x => x.Name == "库房31_温度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 30)
{
return "http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
data = _repository.FindFirst(x => x.Name == "库房31_湿度01");
if (data != null)
{
if (data.IsOnline)
{
decimal value = 0;
if (decimal.TryParse(data.Value, out value))
{
if (value >= 60)
{
return "http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.247&port=80&username=admin&password=hbdq12345&channel=16&iframeid=" + iframeid;
}
}
}
}
return GetTenthRandomAddress() + "&iframeid=" + iframeid;
}
#endregion
#region
public string GetFirstRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk0/hcweb.html?ip=192.168.2.241&port=80&username=admin&password=hbdq12345&channel=11"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetSecondRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk1/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetThirdRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk2/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetFourthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk3/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetFifthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk4/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetSixthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk5/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetSeventhRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk6/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetEighthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk7/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetNinthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk8/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
public string GetTenthRandomAddress()
{
var random = new Random();
string[] predefinedArray = {
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=1",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=2",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=3",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=4",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=5",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=6",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=7",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=8",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=9",
"http://192.168.2.200:9200/hk9/hcweb.html?ip=192.168.2.242&port=80&username=admin&password=hbdq12345&channel=10"
};
if (predefinedArray.Length == 0)
{
throw new InvalidOperationException("预定义数组不能为空");
}
int randomIndex = random.Next(0, predefinedArray.Length);
return predefinedArray[randomIndex];
}
#endregion
}
}