/// <summary> /// 从记录中检索登录用户的信息; /// </summary> private void checkLoginInfo() { write.TxtPath = PathManager.GetInstance().LoginINfoLog; List <string> templist = write.readAllLine(); foreach (var info in templist) { if (info.Contains("username:"******"username:"******""); } else if (info.Contains("password:"******"password:"******""); } else if (info.Contains("host:")) { host_txt.Text = userinfo.host = info.Replace(@"host:", ""); } else if (info.Contains("reomotepath:")) { this.remotePath_txt.Text = userinfo.remotePath = info.Replace(@"reomotepath:", ""); } } }
private void initPath() { this.program_path.Text = PathManager.GetInstance().ProgramPath; this.ftp_path.Text = PathManager.GetInstance().FtpPath; this.copy_path.Text = PathManager.GetInstance().CopyPath; this.change_path.Text = PathManager.GetInstance().ChangePath; this.version_txt.Text = PathManager.GetInstance().VersionTxt; }
private void getList() { write.TxtPath = PathManager.GetInstance().FtpLogPath; filelist = write.readAllLine(); for (var i = 1; i < filelist.Count; i++) { this.filelistbox.Items.Add(filelist[i]); } }
public static void ftpLog(string str) { string logpath = PathManager.GetInstance().FtpLogPath; FileTextChangeManager write = new FileTextChangeManager(logpath); if (isFirstFtpLog) { isFirstFtpLog = false; write.clearAllLine(); write.addOneLine("以下文件需上传"); } write.addOneLine(str); }
internal static void warn(string str) { string logpath = PathManager.GetInstance().LogPath; FileTextChangeManager write = new FileTextChangeManager(logpath); if (isFirstLog) { isFirstLog = false; write.clearAllLine(); } write.addOneLine(str); MessageBox.Show(str); }
private void initText() { // FileTextChangeManager.GetInstance().readAllLine(); FileTextChangeManager textmanager = new FileTextChangeManager(); textmanager.TxtPath = PathManager.GetInstance().ShuomingPath; List <string> temp = textmanager.readAllLine(); for (var i = 0; i < temp.Count; i++) { richTextBox1.AppendText(temp[i]); richTextBox1.AppendText("\n"); } }
private static void addIndexXml() { if (!FilesAndDirsChangeManager.hasSomeFile(path + @"/Index.xml", true)) { write.TxtPath = path + @"/Index.xml"; string p = @"<?xml version=""1.0"" encoding=""utf-8""?> <index> <brand> <main>brand/Main.swf?v=1.0.01291356</main> <skin>brand/Skin.swf?v=1.0.01291356</skin> </brand> <app>game/Game.swf?v=" + PathManager.GetInstance().VersionTxt + @"</app> </index>"; write.addOneLine(p); } ; }
public void changeFilesTime() { List <string> templist = ChangedFilesManager.GetInstance().filePathList; Log.trace("=====修改config.json配置开始====="); int num = 0; foreach (var path in templist) { if (path.Contains("Main.swf")) { continue; } string filename = System.IO.Path.GetFileNameWithoutExtension(path); string fileextension = System.IO.Path.GetExtension(path); // System.Console.WriteLine(System.IO.Path.GetFileName(path)); System.Console.WriteLine(path); string re0 = "(\"" + filename + ")"; string re01 = "(\\.)"; string re02 = "(" + fileextension.Replace(".", "") + ")"; string re03 = "(\\?t=)"; string re1 = "(\\d+)"; // Integer Number 1 string re2 = "(\\.*)"; // Any Single Character 1 string re3 = "(\\d+)"; // Integer Number 2 string re4 = "(\\.*)"; // Any Single Character 2 string re5 = "(\\d+)"; // Integer Number 3 string currenttime = DateTime.Now.ToString("yyMMddhhmm"); bool isfox; writefile.TxtPath = PathManager.GetInstance().ProgramPath + debugPath + configName; isfox = writefile.replaceLineWithReg(re0 + re01 + re02 + re03 + re1 + re2 + re3 + re4 + re5, "\"" + filename + fileextension + "?t=" + currenttime); Log.trace(debugPath + " " + filename + fileextension + " " + (isfox ? "成功" : "失败")); writefile.TxtPath = PathManager.GetInstance().ProgramPath + mayaPath + configName; isfox = writefile.replaceLineWithReg(re0 + re01 + re02 + re03 + re1 + re2 + re3 + re4 + re5, "\"" + filename + fileextension + "?t=" + currenttime); Log.trace(mayaPath + " " + filename + fileextension + " " + (isfox ? "成功" : "失败")); writefile.TxtPath = PathManager.GetInstance().ProgramPath + classicPath + configName; isfox = writefile.replaceLineWithReg(re0 + re01 + re02 + re03 + re1 + re2 + re3 + re4 + re5, "\"" + filename + fileextension + "?t=" + currenttime); Log.trace(classicPath + " " + filename + fileextension + " " + (isfox ? "成功" : "失败")); writefile.TxtPath = PathManager.GetInstance().ProgramPath + junboPath + configName; isfox = writefile.replaceLineWithReg(re0 + re01 + re02 + re03 + re1 + re2 + re3 + re4 + re5, "\"" + filename + fileextension + "?t=" + currenttime); Log.trace(junboPath + " " + filename + fileextension + " " + (isfox?"成功":"失败")); num++; } Log.trace("有 " + num + " 个文件修改"); num = 0; }
public static void addStartTitle() { if (write == null) { write = new FileTextChangeManager(); } addIndexXml(); write.TxtPath = path + @"\" + filename; if (!FilesAndDirsChangeManager.hasSomeFile(write.TxtPath, true)) { write.addOneLine(@"## 版本 (" + PathManager.GetInstance().VersionTxt + ")"); write.addOneLine(@"## 内测"); write.addOneLine(@"## 步骤"); Log.trace("创建文件到 " + write.TxtPath + " 成功"); } else { write.addOneLine("最新记录"); }; }
private void zipUpdateClick(object sender, EventArgs e) { if (zipUtils == null) { zipUtils = new utils.ZipClass(); } if (this.dabao_txt.Text == "") { if (MessageBox.Show("打包版本不能为空", "警告", MessageBoxButtons.OK) == DialogResult.OK) { return; } } string sourcePath = PathManager.GetInstance().CopyPath + @"\" + this.dabao_txt.Text; string targetPath = PathManager.GetInstance().CopyPath + @"\" + this.dabao_txt.Text + @".zip"; zipUtils.ZipFileFromDirectory(sourcePath, targetPath, 9); Log.trace(targetPath + " 创建成功"); connectFtp(targetPath); }
private void get_btn_Click(object sender, EventArgs e) { if (SFTP == null || !SFTP.Connected) { log_tb.AppendText("远程服务器已经断开..." + "\n"); return; } List <string> list = getAllselectedList(); foreach (string line in list) { string remotepath = userinfo.remotePath + line.Replace(PathManager.GetInstance().FtpPath, ""); string tempstr = remotepath.Replace(@"\", @"/"); string localpath = line;//System.IO.Path.GetDirectoryName(line); if (SFTP.Get(tempstr, localpath)) { log_tb.AppendText("获取 " + tempstr + " 成功" + "\n"); } else { log_tb.AppendText("获取 " + tempstr + " 失败" + "\n"); }; } }
private void upload_btn_Click(object sender, EventArgs e) { if (SFTP == null || !SFTP.Connected) { log_tb.AppendText("远程服务器已经断开..." + "\n"); return; } if (userinfo.remotePath == "") { log_tb.AppendText("远程服务器上传目录地址不存在" + "\n"); } // SFTP.Delete(@"/home/javauser/app/egame2.2/egameentrance/client/mayayl/game/json/config.json"); List <string> list = getAllselectedList(); foreach (string line in list) { string temppath = System.IO.Path.GetDirectoryName(line); string remotepath = userinfo.remotePath + line.Replace(PathManager.GetInstance().FtpPath, ""); //k可以是\,也可以是/;当为\时,传值的时候会存在字符串变为 \\ 的现象 //开头一定是\开始 //结尾文件夹+\ //put 返回的结果不一定准确,有时客户端显示正常传递,但实际没有传入,一般是因为 \\ 的原因; remotepath = remotepath.Replace(@"\", @"/"); string templine = line.Replace(@"\", @"/"); if (SFTP.Put(templine, remotepath)) { log_tb.AppendText("上传 " + remotepath + " 成功" + "\n"); } else { log_tb.AppendText("上传 " + remotepath + " 失败" + "\n"); }; } }
/// <summary> /// 登录成功后将登录信息记录到文本中 /// </summary> private void writeLoginInfo() { userinfo.host = host_txt.Text; userinfo.name = this.userName_txt.Text; userinfo.password = this.pw_txt.Text; userinfo.remotePath = this.remotePath_txt.Text; write.TxtPath = PathManager.GetInstance().LoginINfoLog; if (!write.replaceLineText("username:"******"username:"******"username:"******"password:"******"password:"******"password:"******"host:", "host:" + userinfo.host)) { write.addOneLine("host:" + userinfo.host); } if (!write.replaceLineText("reomotepath:", "reomotepath:" + userinfo.remotePath)) { write.addOneLine("reomotepath:" + userinfo.remotePath); } }
/// <summary> /// 将修改的文件从bin-debug覆盖到项目build中,供调试用; /// </summary> public static void copyFilesToProgramBuild() { Log.trace("=====将修改文件copy到项目测试用文件中开始===="); foreach (var file in templist) { // string provider = "mayayl" copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\"; copytargetbuild = PathManager.GetInstance().ProgramPath + @"\build\mayayl\"; if (file.Contains("Main.swf")) { continue; } if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild + file, copytargetbuild + System.IO.Path.GetDirectoryName(file))) { Log.trace("文件copy到 " + copytargetbuild + file + " 成功"); } else { Log.trace("文件copy到 " + copytargetbuild + file + " 失败"); }; // string provider = "classic" string findPath = PathManager.GetInstance().findPathByfile(System.IO.Path.GetFileName(file)); copytargetbuild = PathManager.GetInstance().ProgramPath + @"\build\classic\"; if (file.Contains("Main.swf")) {//main.swf 不copy; continue; } else if (file.Contains(".xml")) { //从bin-debug 中copy 配置文件 copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\" + file; } else if (file.Contains(".swf")) { copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\resource\fla\classic\mayal-20151210\" + findPath + @"\" + System.IO.Path.GetFileName(file); } if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild + System.IO.Path.GetDirectoryName(file))) { Log.trace("文件copy到 " + copytargetbuild + file + " 成功"); } else { Log.trace("文件copy到 " + copytargetbuild + file + " 失败"); }; } //config.json 每个代理商不同,所以在build中直接自动查找需要修改的内容进行修改; //下面是mayayl的config.json,修改的是bin-debug中的config,所以要重新copy一下; copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\"; copytargetbuild = PathManager.GetInstance().ProgramPath + @"\build\mayayl\"; if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild + @"game\json\config.json", copytargetbuild + @"game\json\")) { Log.trace("文件copy到 " + copytargetbuild + @"game\json\config.json" + " 成功"); } else { Log.trace("文件copy到 " + copytargetbuild + @"game\json\config.json" + " 失败"); }; }
/// <summary> /// ftp文件更新 /// 文件夹不可自动生成,必须以覆盖和添加新文件的方式操作 /// 只有在测试用的时候打开 /// </summary> public static void copyFilesToftp() { Log.trace("=====将修改文件copy到ftp文件中开始===="); //每次ftp更新前,需要清理掉原有的日志; Log.isFirstFtpLog = true; //创建文件夹 copytargetbuild = PathManager.GetInstance().FtpPath; // RecursiveFileSearch.hasDirectory(copytargetbuild, true); foreach (var file in templist) { if (file.Contains("Main.swf")) { //copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-release\Main-encrypt.swf"; //copytargetbuild = PathManager.GetInstance().ProgramPath + @"\bin-release\Game.swf"; //if (RecursiveFileSearch.renameFiles(copyresourcebuild, copytargetbuild)) //{ // Log.trace("Main.swf 重命名成功"); //}; copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\" + System.IO.Path.GetDirectoryName(file) + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.mayayl + @"\game\Game.swf"; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\" + System.IO.Path.GetDirectoryName(file) + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.classic + @"\game\Game.swf"; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.junbo + @"\game\Game.swf"; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; } else { if (file.Contains(@".xml")) { foreach (var str in PathManager.gongying) { copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\" + file; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + str + @"\" + System.IO.Path.GetDirectoryName(file); // RecursiveFileSearch.hasDirectory(copytargetbuild, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(file) + " 成功"); Log.ftpLog(copytargetbuild + @"\" + System.IO.Path.GetFileName(file)); } else { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(file) + " 失败"); }; } } if (file.Contains(".swf")) { // string provider = "mayayl" copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\" + System.IO.Path.GetDirectoryName(file) + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.mayayl + @"\" + file; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; // string provider = "classic" string findPath = PathManager.GetInstance().findPathByfile(System.IO.Path.GetFileName(file)); copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\resource\fla\classic\mayal-20151210\" + findPath + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.classic + @"\" + file; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; // string provider = "junbo" findPath = PathManager.GetInstance().findPathByfile(System.IO.Path.GetFileName(file)); copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\resource\fla\classic\mayal-20151210\" + findPath + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.junbo + @"\" + file; // RecursiveFileSearch.hasDirectory(System.IO.Path.GetDirectoryName(copytargetbuild), true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); Log.ftpLog(copytargetbuild); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; } } }//foreach end //copy 自动修改的config.json // string provider = "mayayl" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.mayaPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.mayayl + @"\game\json"; // RecursiveFileSearch.hasDirectory(copytargetbuild, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); Log.ftpLog(copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild)); } else { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; // string provider = "classic" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.classicPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.classic + @"\game\json"; // RecursiveFileSearch.hasDirectory(copytargetbuild, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); Log.ftpLog(copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild)); } else { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; // string provider = "junbo" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.junboPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.junbo + @"\game\json"; // RecursiveFileSearch.hasDirectory(copytargetbuild, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); Log.ftpLog(copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild)); } else { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; //生成ftp中 版本文件Index.xml(打包文件操作和ftp 上传操作互不干扰) copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.mayayl; ModifyIndexXML.addIndexXml(copytargetbuild); copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.classic; ModifyIndexXML.addIndexXml(copytargetbuild); copytargetbuild = PathManager.GetInstance().FtpPath + @"\" + PathManager.junbo; ModifyIndexXML.addIndexXml(copytargetbuild); }
static CopyFilesManger() { copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\"; templist = ChangedFilesManager.GetInstance().filePathList; }
// private string filename = "changefile.txt"; public ChangedFilesManager() { autopathwrite = new FileTextChangeManager(PathManager.GetInstance().ChangePath); filePathList = autopathwrite.readAllLine(); }
/// <summary> /// 将修改的文件复制到文件整理目录中去 /// </summary> public static void copyToPublish() { Log.trace("=====将修改文件copy到公布更新用文件中开始===="); //创建文件夹 string createDirect = @"C_" + DateTime.Now.ToString("yyMMddhhmm"); copytargetbuild = PathManager.GetInstance().CopyPath; FilesAndDirsChangeManager.hasDirectory(copytargetbuild + @"\" + createDirect, true); ReadmeConfig.path = copytargetbuild + @"\" + createDirect; ReadmeConfig.addStartTitle(); foreach (var file in templist) { if (file.Contains("Main.swf")) { //copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-release\Main-encrypt.swf"; //copytargetbuild = PathManager.GetInstance().ProgramPath + @"\bin-release\Game.swf"; //if (RecursiveFileSearch.renameFiles(copyresourcebuild, copytargetbuild)) //{ // Log.trace("Main.swf 重命名成功"); //}; copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\" + System.IO.Path.GetDirectoryName(file) + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\Game.swf"; if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); ReadmeConfig.addConfig("Game.swf", @"/" + PathManager.mayayl + @"/game/"); ReadmeConfig.addConfig("Game.swf", @"/" + PathManager.classic + @"/game/"); ReadmeConfig.addConfig("Game.swf", @"/" + PathManager.junbo + @"/game/"); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; } else if (file.Contains("Locale.xml")) { copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\" + file; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect; FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(file) + " 成功"); ReadmeConfig.addConfig("Locale.xml", @"/mayayl/game/resource/global/zh_cn/"); ReadmeConfig.addConfig("Locale.xml", @"/classic/game/resource/global/zh_cn/"); ReadmeConfig.addConfig("Locale.xml", @"/junbo/game/resource/global/zh_cn/"); } else { Log.trace("文件copy到 " + copytargetbuild + @"\" + System.IO.Path.GetFileName(file) + " 失败"); }; } else { if (file.Contains(".swf")) { // string provider = "mayayl" copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\bin-debug\" + System.IO.Path.GetDirectoryName(file) + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.mayayl + @"\" + System.IO.Path.GetFileName(file); FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.mayayl, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); ReadmeConfig.addConfig(PathManager.mayayl + @"/" + System.IO.Path.GetFileName(file), @"/" + PathManager.mayayl + @"/" + System.IO.Path.GetDirectoryName(file) + @"/"); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; // string provider = "classic" string findPath = PathManager.GetInstance().findPathByfile(System.IO.Path.GetFileName(file)); FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.classic, true); copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\resource\fla\classic\mayal-20151210\" + findPath + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.classic + @"\" + System.IO.Path.GetFileName(file); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); ReadmeConfig.addConfig(PathManager.classic + @"/" + System.IO.Path.GetFileName(file), @"/" + PathManager.classic + @"/" + System.IO.Path.GetDirectoryName(file) + @"/"); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; // string provider = "junbo" findPath = PathManager.GetInstance().findPathByfile(System.IO.Path.GetFileName(file)); FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.junbo, true); copyresourcebuild = PathManager.GetInstance().ProgramPath + @"\resource\fla\classic\mayal-20151210\" + findPath + @"\" + System.IO.Path.GetFileNameWithoutExtension(file) + @"-encrypt.swf"; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.junbo + @"\" + System.IO.Path.GetFileName(file); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + " 成功"); ReadmeConfig.addConfig(PathManager.junbo + @"/" + System.IO.Path.GetFileName(file), @"/" + PathManager.junbo + @"/" + System.IO.Path.GetDirectoryName(file) + @"/"); } else { Log.trace("文件copy到 " + copytargetbuild + " 失败"); }; } } } //copy 自动修改的config.json // string provider = "mayayl" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.mayaPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.mayayl + @"\"; FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.mayayl, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); ReadmeConfig.addConfig(PathManager.mayayl + @"/" + ModifyConfig.configName, @"/mayayl/game/json/"); } else { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; // string provider = "classic" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.classicPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.classic + @"\"; FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.classic, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); ReadmeConfig.addConfig(PathManager.classic + @"/" + ModifyConfig.configName, @"/classic/game/json/"); } else { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; // string provider = "junbo" copyresourcebuild = PathManager.GetInstance().ProgramPath + ModifyConfig.junboPath + ModifyConfig.configName; copytargetbuild = PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.junbo + @"\"; FilesAndDirsChangeManager.hasDirectory(PathManager.GetInstance().CopyPath + @"\" + createDirect + @"\" + PathManager.junbo, true); if (FilesAndDirsChangeManager.copyFiles(copyresourcebuild, copytargetbuild)) { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 成功"); ReadmeConfig.addConfig(PathManager.junbo + @"/" + ModifyConfig.configName, @"/junbo/game/json/"); } else { Log.trace("文件copy到 " + copytargetbuild + System.IO.Path.GetFileName(copyresourcebuild) + " 失败"); }; }
private void startClick(object sender, EventArgs e) { if (this.program_path.Text == "") { //this.program_path.Text = PathManager.GetInstance().ProgramPath; } else { PathManager.GetInstance().ProgramPath = this.program_path.Text; } if (this.program_path.Text == "") { //提示program_path路径不能为空; MessageBox.Show("项目路径不能为空"); return; } // if (this.ftp_path.Text == "") { //this.ftp_path.Text = PathManager.GetInstance().FtpPath; } else { PathManager.GetInstance().FtpPath = this.ftp_path.Text; } if (this.ftp_path.Text == "") { //提示program_path路径不能为空; Log.warn("ftp路径不能为空"); return; } // if (this.copy_path.Text == "") { //this.copy_path.Text = PathManager.GetInstance().CopyPath; } else { PathManager.GetInstance().CopyPath = this.copy_path.Text; } if (this.copy_path.Text == "") { //提示program_path路径不能为空; Log.warn("copy路径不能为空"); return; } // if (this.change_path.Text == "") { // this.change_path.Text = PathManager.GetInstance().ChangePath; } else { PathManager.GetInstance().ChangePath = this.change_path.Text; } if (this.change_path.Text == "") { //提示program_path路径不能为空; Log.warn("change路径不能为空"); return; } // if (this.version_txt.Text == "") { // this.change_path.Text = PathManager.GetInstance().ChangePath; } else { PathManager.GetInstance().VersionTxt = this.version_txt.Text; } if (this.version_txt.Text == "") { //提示program_path路径不能为空; Log.warn("项目版本不能为空"); return; } copyfiles(); }