本文整理汇总了C#中Sites类的典型用法代码示例。如果您正苦于以下问题:C# Sites类的具体用法?C# Sites怎么用?C# Sites使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sites类属于命名空间,在下文中一共展示了Sites类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginSubmit
public int LoginSubmit(Page page, Sites site, string ID, string Password, string InputCheckCode, Shove.Web.UI.ShoveCheckCode sccCheckCode, ref string ReturnDescription)
{
ReturnDescription = "";
bool Opt_isUseCheckCode = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
ID = ID.Trim();
Password = Password.Trim();
if ((ID == "") || (Password == ""))
{
ReturnDescription = "用户名和密码都不能为空";
return -1;
}
if ((Opt_isUseCheckCode) && (!sccCheckCode.Valid(InputCheckCode)))
{
ReturnDescription = "验证码输入错误";
return -2;
}
System.Threading.Thread.Sleep(500);
ElectronTicketAgents electronTicketAgents = new ElectronTicketAgents();
electronTicketAgents.ID = Shove._Convert.StrToInt(ID, 0);
electronTicketAgents.Password = Password;
return electronTicketAgents.Login(ref ReturnDescription);
}
示例2: InitializeRedirectUrls
private void InitializeRedirectUrls()
{
XmlSerializer deserializer = new XmlSerializer(typeof(Sites));
TextReader reader = new StreamReader(@"redirect-URLs.xml");
this.sites = (Sites)deserializer.Deserialize(reader);
reader.Close();
}
示例3: SendEmail
public static int SendEmail(Sites Site, string MailTo, string Subject, string Body)
{
SendEmailTask sendemailtask = new SendEmailTask(Site, MailTo, Subject, Body);
sendemailtask.Run();
return 0;
}
示例4: SendSMS
public static int SendSMS(Sites Site, long UserID, string Mobile, string Content) // UserID 付费用户, < 0 则系统付费
{
if ((Site == null) || (Site.ID < 0))
{
return -1;
}
DAL.Tables.T_SMS sms = new DAL.Tables.T_SMS();
sms.SiteID.Value = Site.ID;
sms.SMSID.Value = -1;
sms.From.Value = "";
sms.To.Value = Mobile;
sms.Content.Value = Content;
sms.IsSent.Value = false;
sms.Insert();
return 0;
//SendSMSTask sendsmstask = new SendSMSTask(Site, UserID, Mobile, Content);
//sendsmstask.Run();
//return 0;
}
示例5: GetFilterUrl
/// <summary>
/// Gets an Url for the MediaPortal IPTV filter with user settings of the site applied.
/// </summary>
/// <param name="siteUtil">The <see cref="Sites.SiteUtilBase"/> instance with url settings.</param>
/// <param name="url">A string containing the base64 encoded binary serialized data of a supported <see cref="SimpleUrl"/> inheriting class.</param>
/// <returns></returns>
public static String GetFilterUrl(Sites.SiteUtilBase siteUtil, String url)
{
int index = url.IndexOf(SimpleUrl.ParameterSeparator);
SimpleUrl simpleUrl = null;
if (index != -1)
{
String encodedContent = url.Substring(index + SimpleUrl.ParameterSeparator.Length);
simpleUrl = SimpleUrl.FromString(encodedContent);
if (simpleUrl == null)
throw new OnlineVideosException(Translation.Instance.UnableToPlayVideo);
}
else
{
simpleUrl = UrlFactory.CreateUrl(url);
if (simpleUrl == null)
return url;
}
//simpleUrl.CacheFolder =; simpleUrl.MaximumLogSize =; simpleUrl.MaximumPlugins =; simpleUrl.Verbosity =;
if (siteUtil != null)
simpleUrl.ApplySettings(siteUtil);
return simpleUrl.ToFilterString();
}
示例6: SendEmailTask
public SendEmailTask(Sites site, string mailto, string subject, string body)
{
this.Site = site;
this.MailTo = mailto;
this.Subject = subject;
this.Body = body;
}
示例7: SetCheckCode
public void SetCheckCode(Sites site, Shove.Web.UI.ShoveCheckCode sccCheckCode)
{
switch (site.SiteOptions["Opt_CheckCodeCharset"].ToShort(0))
{
case 0:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
break;
case 1:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetter;
break;
case 2:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterLower;
break;
case 3:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyLetterUpper;
break;
case 4:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.OnlyNumeric;
break;
default:
sccCheckCode.Charset = Shove.Web.UI.ShoveCheckCode.CharSet.All;
break;
}
}
示例8: OnLoad
protected override void OnLoad(EventArgs e)
{
#region 获取站点
//_Site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
_Site = new Sites()[1];
if (_Site == null)
{
PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName);
return;
}
#endregion
#region 获取用户
_ElectronTicketAgents = ElectronTicketAgents.GetCurrentUser();
if (isRequestLogin && (_ElectronTicketAgents == null))
{
Response.Redirect("Login.aspx");
return;
}
#endregion
HtmlMeta hm = new HtmlMeta();
hm.HttpEquiv = "X-UA-Compatible";
hm.Content = "IE=EmulateIE7";
base.OnLoad(e);
}
示例9: LoginSubmit
public int LoginSubmit(Page page, Sites site, string Name, string Password, string InputCheckCode, ShoveCheckCode sccCheckCode, ref string ReturnDescription)
{
ReturnDescription = "";
bool flag = site.SiteOptions["Opt_isUseCheckCode"].ToBoolean(true);
Name = Name.Trim();
Password = Password.Trim();
if ((Name == "") || (Password == ""))
{
ReturnDescription = "用户名和密码都不能为空";
return -1;
}
if (flag)
{
if (sccCheckCode == null)
{
ReturnDescription = "验证码内部错误";
return -2;
}
if (!sccCheckCode.Valid(InputCheckCode))
{
ReturnDescription = "验证码输入错误";
return -3;
}
}
Thread.Sleep(500);
return new Users(site.ID) { Name = Name, Password = Password }.Login(ref ReturnDescription);
}
示例10: Submit
public System.Web.Mvc.ActionResult Submit(Sites.Models.Site site, System.Web.Mvc.ControllerContext controllerContext, Sites.Models.SubmissionSetting submissionSetting)
{
var request = controllerContext.HttpContext.Request;
var action = request["action"];
var jsonResultData = new JsonResultData();
object result = null;
try
{
if (action == "get-addresses")
{
result = GetAddresses(site, controllerContext);
}
jsonResultData.Success = true;
jsonResultData.Model = result;
}
catch (Exception ex)
{
jsonResultData.Success = false;
jsonResultData.AddException(ex);
}
return new JsonResult { Data = jsonResultData, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
}
示例11: OnLoad
protected override void OnLoad(EventArgs e)
{
#region 获取站点
_Site = new Sites()[1];
if (_Site == null)
{
PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().FullName);
return;
}
#endregion
#region 获取用户
Users users = Users.GetCurrentUser(1);
if (users == null)
{
PF.GoLogin(RequestLoginPage, false);
return;
}
if (_User == null)
{
_User = Session["CpsAdminPageBase_Users"] as Users;
}
if (_User == null)
{
PF.GoLogin(RequestLoginPage, false);
return;
}
#endregion
#region 判断权限
if (!users.Competences.IsOwnedCompetences(RequestCompetences))
{
PF.GoError(ErrorNumber.NotEnoughCompetence, "对不起,您没有足够的权限访问此页面", this.GetType().FullName);
return;
}
#endregion
HtmlMeta hm = new HtmlMeta();
hm.HttpEquiv = "X-UA-Compatible";
hm.Content = "IE=EmulateIE7";
PageUrl = this.Request.Url.AbsoluteUri;
base.OnLoad(e);
}
示例12: SendEmailTask
public SendEmailTask(Sites site, string mailto, string subject, string body)
{
Site = site;
MailTo = mailto;
Subject = subject;
Body = body;
}
示例13: Create
public static DownloadInfo Create(VideoInfo video, Category category, Sites.SiteUtilBase site)
{
DownloadInfo di = (DownloadInfo)CrossDomain.OnlineVideosAppDomain.Domain.CreateInstanceAndUnwrap(typeof(DownloadInfo).Assembly.FullName, typeof(DownloadInfo).FullName, false, System.Reflection.BindingFlags.CreateInstance | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic, null, null, null, null);
di.VideoInfo = video;
di.Category = category;
di.Util = site;
return di;
}
示例14: GetSites
protected override Sites GetSites()
{
List<Site> sites = SiteConfiguration.GetSites();
Sites clonedSites = new Sites();
foreach (Site site in sites)
clonedSites.Add(new Site() { ID = site.ID, Name = site.Name, Url = site.Url,
ProductVersion = site.ProductVersion });
return clonedSites;
}
示例15: OnLoad
protected override void OnLoad(EventArgs e)
{
string ReturnDescription = "";
#region 获取站点
_Site = new Sites()[1];
if (_Site == null)
{
PF.GoError(ErrorNumber.Unknow, "域名无效,限制访问", this.GetType().BaseType.FullName);
return;
}
#endregion
#region 获取用户
_User = Users.GetCurrentUser(_Site.ID);
if (isRequestLogin && (_User == null))
{
GoLogin(RequestLoginPage);
return;
}
if (isCpsRequestLogin && (_User.cps.ID < 0))
{
_User.Logout(ref ReturnDescription);
PF.GoError(ErrorNumber.Unknow, "您不是 CPS 用户", this.GetType().BaseType.FullName);
return;
}
if (isCpsRequestLogin && !_User.cps.ON)
{
_User.Logout(ref ReturnDescription);
PF.GoError(ErrorNumber.Unknow, "用户被冻结", this.GetType().BaseType.FullName);
return;
}
#endregion
HtmlMeta hm = new HtmlMeta();
hm.HttpEquiv = "X-UA-Compatible";
hm.Content = "IE=EmulateIE7";
PageUrl = this.Request.Url.AbsoluteUri;
base.OnLoad(e);
}