if(reg_status1 == "on" && reg_status2 == "on" && uslovie == "on") {
$('#submit_r').removeAttr('disabled');
}
else {
$('#submit_r').attr('disabled', 'disabled');
}
$("input[id='uploadFile']").change(function(e){
var tgt = e.target || window.event.srcElement;
var files = tgt.files;
if (FileReader && files && files.length) {
var newImg = "<img id='new-img' src='#' alt='' class='img-thumbnail'/>";
var selectedFile = files[0];
var fr = new FileReader();
fr.onload = function () {
newImg = newImg.replace("#", fr.result);
}
fr.readAsDataURL(selectedFile);
var fdata = new FormData();
fdata.append("file", selectedFile);
....
}
});
public bool IsBelong(Point point, IGeometryObject geoGeometry)
{
var polygon = ((Polygon) geoGeometry).Coordinates;
var inPolygon = false;
var x = point.Coordinates.Latitude;
var y = point.Coordinates.Longitude;
var points = polygon[0].Coordinates;
for (var i = 0; i < points.Count - 1; i++)
{
if (((points[i + 1].Longitude > y) != (points[i].Longitude >= y))
&&
(x < (points[i].Latitude - points[i + 1].Latitude) * (y - points[i + 1].Longitude) / (points[i].Longitude - points[i + 1].Longitude) + points[i + 1].Latitude))
{
inPolygon = !inPolygon;
}
}
return inPolygon;
}
static void Main(string[] args)
{
var str = "{1|2|4}{1|3|3}{2|2|3}{1|1|3}";
var number = new [] { "3", "2", "1", "2" };
var temp = str
.Trim('{', '}')
.Split(new []{ "}{" }, StringSplitOptions.None)
.Select(x => x.Split('|').ToArray())
.ToArray();
var result = new StringBuilder();
for (var i = 0; i < temp.Length; i++)
{
var isParse = int.TryParse(number[i], out int index);
if (isParse)
{
result.Append(temp[i][index - 1]);
}
}
Console.WriteLine(result);
Console.ReadKey();
}
abstract class A
{
protected string _value;
}
class B : A
{
// Через общее отнаследованное поле
public string ValueB { get { return _value; } set { _value = value; } }
}
class C : A
{
private string _valueC;
public C(string any)
{ }
// Через конструктор
public C(string any)
{
_valueC = any;
}
public string ValueC { get { return _value; } set { _value = value; } }
// Через метод
public void SetMethod(string any)
{
_valueC = any
}
}
var b = new B();
var c = new C();
b.ValueB = "any"; // c.ValueC = "any"
// так же как и
c.ValueC = "any"; // b.ValueB = "any"
b.ValueB = "any";
// Через конструктор
var c = new C(b.ValueB);
// Через метод
c.SetMethod(b.ValueB);
class SmtpSetting
{
public string Host {get; set;}
public string Server {get; set;}
public string Port {get; set;}
}
var smptSettings = new List<SmptSetting>
{
new SmptSetting
{
Host = "mail.ru",
Server = "smtp.mail.ru",
Port = 587
},
new SmptSetting
{
Host = "yahoo.co",
Server = "smtp.yahoo.co",
Port = 465
},
...
}
var currentSmtp = smptSettings.FirstOrDefault(x => x.Host == host);
if(currentSmtp != null)
{
var smtp = new SmtpClient(currentSmtp.Server, currentSmtp.Port);
}
MailMessage
есть настройка IsBodyHtml
, установите ее в true.