Guest Report post Posted October 22, 2016 Use it to remove comments from a file. Download Quote Share this post Link to post Share on other sites
Wrexor 61 Report post Posted October 22, 2016 If someone is interesting in source code: using System; using System.IO; using System.Text.RegularExpressions; internal class a { private static string b(string A_0) { string pattern = "(@(?:\"[^\"]*\")+|\"(?:[^\"\\n\\\\]+|\\\\.)*\"|'(?:[^'\\n\\\\]+|\\\\.)*')|//.*|/\\*(?s:.*?)\\*/"; return Regex.Replace(A_0, pattern, "$1"); } private static string aa(string A_0) { return Regex.Replace(A_0, "^\\s+$[\\r\\n]*", "", RegexOptions.Multiline); } private static void Main(string[] A_0) { Console.Title = "Comments removal tool - Rtz"; Console.WriteLine("Please enter the path to the file:\n"); try { string path = Console.ReadLine(); string contents = a.aa(a.b(File.ReadAllText(path))); File.WriteAllText(path, contents); Console.WriteLine("\nAll comments were successfully removed from - " + path); Console.WriteLine("\nPress any key to exit"); } catch (Exception ex) { Console.WriteLine(Environment.NewLine + ex.Message); } Console.ReadKey(); } } Quote Share this post Link to post Share on other sites
Guest Report post Posted October 22, 2016 5 minutes ago, Wrexor said: ... ye, the built-in vs obfusctator is amazing xD. Quote Share this post Link to post Share on other sites
Lua 35 Report post Posted October 26, 2019 any1 got a new link for this? Quote Share this post Link to post Share on other sites
mkhzaleh 131 Report post Posted October 26, 2019 2 hours ago, Lua said: any1 got a new link for this? On 10/23/2016 at 12:28 AM, Wrexor said: If someone is interesting in source code: using System; using System.IO; using System.Text.RegularExpressions; internal class a { private static string b(string A_0) { string pattern = "(@(?:\"[^\"]*\")+|\"(?:[^\"\\n\\\\]+|\\\\.)*\"|'(?:[^'\\n\\\\]+|\\\\.)*')|//.*|/\\*(?s:.*?)\\*/"; return Regex.Replace(A_0, pattern, "$1"); } private static string aa(string A_0) { return Regex.Replace(A_0, "^\\s+$[\\r\\n]*", "", RegexOptions.Multiline); } private static void Main(string[] A_0) { Console.Title = "Comments removal tool - Rtz"; Console.WriteLine("Please enter the path to the file:\n"); try { string path = Console.ReadLine(); string contents = a.aa(a.b(File.ReadAllText(path))); File.WriteAllText(path, contents); Console.WriteLine("\nAll comments were successfully removed from - " + path); Console.WriteLine("\nPress any key to exit"); } catch (Exception ex) { Console.WriteLine(Environment.NewLine + ex.Message); } Console.ReadKey(); } } just build it in vs Quote Share this post Link to post Share on other sites
Lua 35 Report post Posted January 27, 2022 I tried to compile using vs2019 and it compiles correctly (but the program doesn't work as it should). Should I use another version of vs? Quote Share this post Link to post Share on other sites
V3ct0r 2,117 Report post Posted February 1, 2022 On 1/27/2022 at 5:35 PM, Lua said: I tried to compile using vs2019 and it compiles correctly (but the program doesn't work as it should). Should I use another version of vs? I think it doesn't depend on Visual Studio version. What specific errors in the program did you notice? Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
Lua 35 Report post Posted February 2, 2022 On 2/1/2022 at 3:40 AM, V3ct0r said: I think it doesn't depend on Visual Studio version. What specific errors in the program did you notice? It simply doesn't change anything on the archive :// Quote Share this post Link to post Share on other sites