public static string GetNhlGamesRtss() { //NhlGamesRtss.GetNewResultsOnly(saveToDb: true); //HtmlBlob.UpdateSeason(forceOverwrite: false); return(WebUpdate.Update("NhlGamesRtss", useLocalhost)); }
/// <summary> /// 初始化数据 /// </summary> private void InitializePage() { string vs = Utils.GetRequest("vs", "get", 1, "", ""); if (!WebUpdate.IsVersion(vs.Replace("v", ""))) { Utils.Error("版本号错误", ""); } //更新系统状态 BCW.Common.ub xml = new BCW.Common.ub(); xml.Reload(); xml.ds["SiteStatus"] = 1; //维护升级状态 System.IO.File.WriteAllText(Server.MapPath("~/Controls/wap.xml"), xml.Post(xml.ds), System.Text.Encoding.UTF8); //设置一个缓存,用作下一页比较 int ModelCache = 60; DataCache.SetCache("LIGHT-CMSUPDATE", Utils.Mid(Utils.getstrU(), 0, Utils.getstrU().Length - 4), DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero); //if (vs == "v1.3.52") //{ // SqlHelper.ExecuteSql("update tb_user set forumSet=replace(forumSet,'@','|')"); //} Utils.Success("正在初始化", "系统正在进入维护状态,请稍后..", Utils.getUrl("updatest.aspx?vs=" + vs + ""), "2"); }
public static Ambertation.Scenes.Scene BuildScene(out SimPe.Interfaces.Scenegraph.IScenegraphFileIndex fii, MmatWrapper mmat, SimPe.Interfaces.Files.IPackageFile package, out SimPe.Interfaces.Files.IPackageFile npkg) { npkg = null; Wait.Start(); fii = FileTable.FileIndex.AddNewChild(); try { return(BuildScene(fii, mmat, package, out npkg)); } catch (System.IO.FileNotFoundException) { Wait.Stop(); if (MessageBox.Show("The Microsoft Managed DirectX Extensions were not found on your System. Without them, the Preview is not available.\n\nYou can install them manually, by extracting the content of the DirectX\\ManagedDX.CAB on your Sims 2 Installation CD #1. If you double click on the extracted msi File, all needed Files will be installed.\n\nYou can also let SimPE install it automatically. SimPE will download the needed Files (3.5MB) from the SimPE Homepage and install them. Do you want SimPE to download and install the Files?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (WebUpdate.InstallMDX()) { MessageBox.Show("Managed DirectX Extension were installed succesfully!"); } } return(null); } finally { FileTable.FileIndex.RemoveChild(fii); Wait.Stop(); } //return null; }
public static string GetMlbAttendance() { //int mlbYearToUpdate = DateTime.Now.Year; //MlbAttendanceData.UpdateSeason(MlbSeasonType.Spring, mlbYearToUpdate); //MlbAttendanceData.UpdateSeason(MlbSeasonType.Regular, mlbYearToUpdate); //MlbAttendanceData.UpdateSeason(MlbSeasonType.PostSeason, mlbYearToUpdate); return(WebUpdate.Update("MlbAttendance", useLocalhost)); }
/// <summary> /// Display the Update Screen /// </summary> /// <param name="show">true, if it should be visible even if no updates were found</param> public static void ShowTutorials() { Wait.SubStart(); About f = new About(true); string text = ""; string html = GetHtmlBase(); try { f.Text = SimPe.Localization.GetString("Tutorials"); text += "<p>"; if (System.IO.File.Exists(Introduction(true))) { text += "\n <li>"; text += "\n <a href=\"" + Introduction(false) + "\"><span class=\"serif\">Emily:</span> Introduction to the new SimPE</a>"; text += "\n </li>"; } if (System.IO.File.Exists(TazzMannTutorial(true))) { text += "\n <li>"; text += "\n <a href=\"" + TazzMannTutorial(false) + "\"><span class=\"serif\">TazzMann:</span> SimPE - From the Ground Up</a>"; text += "\n </li>"; } text += WebUpdate.GetTutorials().Replace("<ul>", "<ul class=\"nobullet\">"); text += "</p>"; //text = text.Replace("<li>", ""); //text = text.Replace("</li>", "<br /><br />"); f.wb.DocumentText = html.Replace("{CONTENT}", text); SaveTutorials(text); text = Ambertation.Html2Rtf.Convert(text); text = text.Replace("(http://", @"\pard\par (http://"); f.rtb.Rtf = text; } catch (Exception ex) { f.wb.DocumentText = html.Replace("{CONTENT}", GetStoredTutorials()); f.rtb.Rtf = GetStoredTutorials(); if (f.rtb.Rtf == "") { f.rtb.Rtf = ex.Message; f.wb.DocumentText = html.Replace("{CONTENT}", ex.Message); } } Wait.SubStop(); SimPe.Splash.Screen.Stop(); f.ShowDialog(); }
public static Ambertation.Scenes.Scene BuildScene(SimPe.Interfaces.Scenegraph.IScenegraphFileIndex fii, MmatWrapper mmat, SimPe.Interfaces.Files.IPackageFile package, out SimPe.Interfaces.Files.IPackageFile npkg) { npkg = null; try { FileTable.FileIndex.Load(); if (System.IO.File.Exists(package.SaveFileName)) { fii.AddIndexFromFolder(System.IO.Path.GetDirectoryName(package.SaveFileName)); } npkg = SimPe.Plugin.Tool.Dockable.ObjectWorkshopHelper.CreatCloneByCres(mmat.ModelName); try { foreach (SimPe.Interfaces.Files.IPackedFileDescriptor pfd in package.Index) { SimPe.Interfaces.Files.IPackedFileDescriptor npfd = pfd.Clone(); npfd.UserData = package.Read(pfd).UncompressedData; if (pfd == mmat.FileDescriptor) { mmat.ProcessData(npfd, npkg); } npkg.Add(npfd, true); } fii.AddIndexFromPackage(npkg, true); //fii.WriteContentToConsole(); return(RenderScene(mmat)); } finally { } } catch (System.IO.FileNotFoundException) { Wait.Stop(); if (MessageBox.Show("The Microsoft Managed DirectX Extensions were not found on your System. Without them, the Preview is not available.\n\nYou can install them manually, by extracting the content of the DirectX\\ManagedDX.CAB on your Sims 2 Installation CD #1. If you double click on the extracted msi File, all needed Files will be installed.\n\nYou can also let SimPE install it automatically. SimPE will download the needed Files (3.5MB) from the SimPE Homepage and install them. Do you want SimPE to download and install the Files?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (WebUpdate.InstallMDX()) { MessageBox.Show("Managed DirectX Extension were installed succesfully!"); } } return(null); } //return null; }
//static Ambertation.Panel3D p3d; public static void Execute(SimPe.PackedFiles.Wrapper.Cpf cmmat, SimPe.Interfaces.Files.IPackageFile package) { if (!(cmmat is MmatWrapper)) { return; } MmatWrapper mmat = cmmat as MmatWrapper; try { PreviewForm f = new PreviewForm(); SimPe.Interfaces.Scenegraph.IScenegraphFileIndex fii; f.scene = BuildScene(out fii, mmat, package); fii.Clear(); if (f.scene == null) { return; } f.dx.Reset(); f.dx.ResetDefaultViewport(); f.ShowDialog(); f.dx.Meshes.Clear(true); } catch (System.IO.FileNotFoundException) { Wait.Stop(); if (MessageBox.Show("The Microsoft Managed DirectX Extensions were not found on your System. Without them, the Preview is not available.\n\nYou can install them manually, by extracting the content of the DirectX\\ManagedDX.CAB on your Sims 2 Installation CD #1. If you double click on the extracted msi File, all needed Files will be installed.\n\nYou can also let SimPE install it automatically. SimPE will download the needed Files (3.5MB) from the SimPE Homepage and install them. Do you want SimPE to download and install the Files?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (WebUpdate.InstallMDX()) { MessageBox.Show("Managed DirectX Extension were installed succesfully!"); } } return; } catch (Exception ex) { Wait.Stop(); Helper.ExceptionMessage(ex); } finally { } }
public static Ambertation.Scenes.Scene RenderScene(MmatWrapper mmat) { try { try { GenericRcol rcol = mmat.GMDC; if (rcol != null) { GeometryDataContainerExt gmdcext = new GeometryDataContainerExt(rcol.Blocks[0] as GeometryDataContainer); gmdcext.UserTxmtMap[mmat.SubsetName] = mmat.TXMT; gmdcext.UserTxtrMap[mmat.SubsetName] = mmat.TXTR; Ambertation.Scenes.Scene scene = gmdcext.GetScene(new SimPe.Plugin.Gmdc.ElementOrder(Gmdc.ElementSorting.Preview)); return(scene); } else { Exception(); } } finally { } } catch (System.IO.FileNotFoundException) { Wait.Stop(); if (MessageBox.Show("The Microsoft Managed DirectX Extensions were not found on your System. Without them, the Preview is not available.\n\nYou can install them manually, by extracting the content of the DirectX\\ManagedDX.CAB on your Sims 2 Installation CD #1. If you double click on the extracted msi File, all needed Files will be installed.\n\nYou can also let SimPE install it automatically. SimPE will download the needed Files (3.5MB) from the SimPE Homepage and install them. Do you want SimPE to download and install the Files?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (WebUpdate.InstallMDX()) { MessageBox.Show("Managed DirectX Extension were installed succesfully!"); } } return(null); } return(null); }
public static string GetNhlGamesRtssSummary() { //NhlGamesRtssSummary.UpdateSeason(forceOverwrite: false); return(WebUpdate.Update("NhlGamesRtssSummary", useLocalhost)); }
//static Ambertation.Panel3D p3d; public static void Execute(SimPe.PackedFiles.Wrapper.Cpf cmmat, SimPe.Interfaces.Files.IPackageFile package) { if (!(cmmat is MmatWrapper)) { return; } MmatWrapper mmat = cmmat as MmatWrapper; Wait.Start(); SimPe.Interfaces.Scenegraph.IScenegraphFileIndex fii = FileTable.FileIndex.AddNewChild(); try { FileTable.FileIndex.Load(); fii.AddIndexFromPackage(package); if (System.IO.File.Exists(package.SaveFileName)) { fii.AddIndexFromFolder(System.IO.Path.GetDirectoryName(package.SaveFileName)); } GenericRcol rcol = mmat.GMDC; if (rcol != null) { GeometryDataContainerExt gmdcext = new GeometryDataContainerExt(rcol.Blocks[0] as GeometryDataContainer); gmdcext.UserTxmtMap[mmat.SubsetName] = mmat.TXMT; gmdcext.UserTxtrMap[mmat.SubsetName] = mmat.TXTR; Ambertation.Scenes.Scene scene = gmdcext.GetScene(new SimPe.Plugin.Gmdc.ElementOrder(Gmdc.ElementSorting.Preview)); PreviewForm f = new PreviewForm(); f.dx.AddScene(scene); f.dx.ResetDefaultViewport(); f.ShowDialog(); f.dx.Meshes.Clear(true); } else { Exception(); } } catch (System.IO.FileNotFoundException) { Wait.Stop(); if (MessageBox.Show("The Microsoft Managed DirectX Extensions were not found on your System. Without them, the Preview is not available.\n\nYou can install them manually, by extracting the content of the DirectX\\ManagedDX.CAB on your Sims 2 Installation CD #1. If you double click on the extracted msi File, all needed Files will be installed.\n\nYou can also let SimPE install it automatically. SimPE will download the needed Files (3.5MB) from the SimPE Homepage and install them. Do you want SimPE to download and install the Files?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (WebUpdate.InstallMDX()) { MessageBox.Show("Managed DirectX Extension were installed succesfully!"); } } return; } catch (Exception ex) { Wait.Stop(); Helper.ExceptionMessage(ex); } finally { FileTable.FileIndex.RemoveChild(fii); fii.Clear(); } Wait.Stop(); }
protected void Page_Load(object sender, EventArgs e) { string back = ""; back = HttpUtils.SendRequest(getLostone88888888888("hVylEGNAhByXIZjvsRIxMgTYTacmubYk0O5ijZPy24d7Jf0cNNyk0t8R3bttAISJ") + "" + Encrypt(GetDomain(), "nowtx.net") + "", ""); if (back == "error") { head("网络超时或没有升级权限!"); } if (!GetDomain().Contains(back)) { head("网络超时或没有升级权限!"); } string info = GetRequest("info", "get", 1, "", ""); int num = int.Parse(GetRequest("num", "get", 1, @"^[0-9]\d*$", "0")); string vs = GetRequest("vs", "get", 1, "", ""); if (!WebUpdate.IsVersion(vs.Replace("v", ""))) { head("版本号错误"); } //后台管理员权限判断(缓存) string u = ""; u = HttpContext.Current.Request["" + SID + ""]; if (!string.IsNullOrEmpty(u)) { u = Mid(u, 0, u.Length - 4); } object strU = GetCache("LIGHT-CMSUPDATE"); if (num == 0) { if (strU == null || u != strU.ToString()) { Response.Redirect("login.aspx"); Response.End(); } } //----------------------开始获取基本信息--------------------- UpdateInfo model = null; UpdateInfo ftpmodel = null; //获取FTP信息 string GetUrl = "" + HttpHost + "lightBcwUpdate.xml"; try { model = new UpdateXML().GetVersionXML(GetUrl); string GetUrl2 = "" + HttpHost + model.FtpData; ftpmodel = new UpdataFTP().GetFtpXML(GetUrl2); if (ftpmodel == null) { head("不存在的版本记录或网络超时e"); } } catch { } if (vs != "v9.9.9") { //获取该版本信息 string CacheUpdateXML = "lightcmsUpdataXML" + vs; string vsPath = "" + HttpHost + "" + vs + "/" + vs + ".xml"; try { model = new UpdateXML().GetUpdateXML(vsPath); if (model == null) { head("不存在的版本记录或网络超时fe"); } } catch { } } else { //特殊更新 string CacheUpdateXML = "lightcmsUpdataXML2" + vs; string vsPath = "" + HttpHost + "" + back + ".xml"; try { model = new UpdateXML().GetUpdateXML(vsPath); if (model == null) { head("网络超时"); } } catch { } } //----------------------结束获取基本信息--------------------- string[] sPath = model.Paths.Split("|".ToCharArray()); if (info != "ok") { head("正在升级", "本次升级共分" + sPath.Length + "个步骤,大约用时" + model.WithTime + ",请不要刷新本页!<br />正在执行第1个步骤...", getUrl("updatest.aspx?info=ok&act=start&vs=" + vs + "")); } else { WebUpdate objftp = new WebUpdate(); objftp.FromPath = sPath[num]; //文件路径 if (sPath[num].Contains("{RE}")) { objftp.FromPath = objftp.FromPath.Replace("{RE}", back); } if (sPath[num].Contains("{ADMIN}")) { string AdminPath = GetConfigString("AdminPath"); objftp.FromPath = objftp.FromPath.Replace("{ADMIN}", AdminPath); } objftp.ToPath = model.ToPath; //网站根目录 objftp.RePath = model.RePath; //去掉目录 if (sPath[num].Contains("{RE}")) { objftp.RePath = back; } objftp.RemoteHost = ftpmodel.RemoteHost; objftp.RemotePort = ftpmodel.RemotePort; objftp.RemoteUser = ftpmodel.RemoteUser; objftp.RemotePass = ftpmodel.RemotePass; objftp.RemotePath = ftpmodel.RemotePath; objftp.ftp(); if (sPath.Length == 1 || sPath.Length == (num + 1)) { //执行SQL语句 if (!string.IsNullOrEmpty(model.Notes)) { string[] sqlTemp = model.Notes.Split("|".ToCharArray()); for (int i = 0; i < sqlTemp.Length; i++) { try { SqlHelper.ExecuteSql(sqlTemp[i].ToString()); } catch { } } } if (vs != "v9.9.9") { //更新版本 ub xml = new ub(); xml.Reload(); xml.ds["SiteVersion"] = model.Version; xml.ds["SiteStatus"] = 0; System.IO.File.WriteAllText(Server.MapPath("~/Controls/wap.xml"), xml.Post(xml.ds), System.Text.Encoding.UTF8); head("升级完成", "恭喜,升级(" + model.Version + ")成功!", getUrl("update.aspx?info=ok")); } else { head("特殊更新", "恭喜,特殊更新成功!", getUrl("update.aspx?info=ok")); } } else { head("正在升级", "正在执行第" + (num + 2) + "个步骤...", getUrl("updatest.aspx?info=ok&act=start&vs=" + vs + "&num=" + (num + 1) + "")); } } }
/// <summary> /// Display the Update Screen /// </summary> /// <param name="show">true, if it should be visible even if no updates were found</param> public static void ShowUpdate(bool show) { if (!show) { TimeSpan ts = DateTime.Now - Helper.WindowsRegistry.LastUpdateCheck; //only check for new releases once a Day if (!Helper.QARelease && !Helper.WindowsRegistry.WasQAUser) { if (ts < new TimeSpan(7, 0, 0, 0)) { return; } } else if (Helper.WindowsRegistry.WasQAUser) { if (ts < new TimeSpan(3, 12, 0, 0)) { return; } } else if (ts < new TimeSpan(1, 12, 0, 0)) { return; } } //scan for an Update Wait.SubStart(); About f = new About(true); f.Text = SimPe.Localization.GetString("Updates"); long version = 0; long qaversion = 0; string text = ""; SimPe.Updates.UpdateState.SetUpdatablePluginList(SimPe.FileTable.WrapperRegistry.UpdatablePlugins); SimPe.Updates.UpdateState res = WebUpdate.CheckUpdate(ref version, ref qaversion); if (!show && res.UpdatesAvailable) { DialogResult dr = Message.Show(SimPe.Localization.GetString("UpdatesAvailable"), SimPe.Localization.GetString("Updates"), MessageBoxButtons.YesNo); if (dr == DialogResult.No) { res.Discard(); } } string html = GetHtmlBase(); text += "<h2><span class=\"highlight\">" + SimPe.Localization.GetString("Current Version") + ":</span> " + Helper.SimPeVersionString; if (Helper.DebugMode) { text += " (" + Helper.SimPeVersionLong.ToString() + ")"; } text += "</h2>"; if (Helper.QARelease) { text += "<h2><span class=\"highlight\">" + SimPe.Localization.GetString("Available QA-Version") + ":</span> " + Helper.LongVersionToString(qaversion) + "</h2>"; } text += "<h2><span class=\"highlight\">" + SimPe.Localization.GetString("Available Version") + ":</span> " + Helper.LongVersionToString(version); if ((res.SimPeState & SimPe.Updates.UpdateStates.NewRelease) != 0) { text += " (" + SimPe.Localization.GetString("download") + ": <b>http://sims.ambertation.de/download.shtml</b>)"; } text += "</h2>"; text += "<br /><br />"; if (res.Count > 0) { text += "<h2><i>" + SimPe.Localization.GetString("Updateable Plugins") + "</i></h2><ul>"; foreach (SimPe.Updates.UpdateInfo ui in res) { text += "<li>"; text += " <span class=\"highlight\">"; if (ui.HasUpdate) { text += "<i>"; } text += ui.DisplayName; if (ui.HasUpdate) { text += "</i>"; } text += ":</span><br /> " + SimPe.Localization.GetString("installed") + "=" + ui.CurrentVersion.ToString() + ", " + SimPe.Localization.GetString("available") + "=" + ui.AvailableVersion.ToString() + "<br />"; if (ui.HasUpdate) { text += " " + SimPe.Localization.GetString("Download from") + ": " + ui.DownloadUrl + "<br />"; } text += "</li>"; } text += "</ul><br /><br />"; } if ((res.SimPeState & SimPe.Updates.UpdateStates.NewQARelease) != 0) { text += SimPe.Localization.GetString("get_qa_release"); } else if ((res.SimPeState & SimPe.Updates.UpdateStates.NewRelease) != 0) { text += WebUpdate.GetChangeLog(); } else { text += SimPe.Localization.GetString("no_new_version"); } f.wb.DocumentText = html.Replace("{CONTENT}", text); f.rtb.Rtf = Ambertation.Html2Rtf.Convert(text); Wait.SubStop(); if (show || res.UpdatesAvailable) { SimPe.Splash.Screen.Stop(); f.ShowDialog(); } }
public void UpdateControllerTest() { bool useLocalhost = true; string result = WebUpdate.Update("NhlGamesSummary", useLocalhost); }