예제 #1
0
        internal static void WriteTempContent(SpinProxiesRootResponse data, SpinProxiesProxyClass proxyClass)
        {
            // For viewing live data
            try
            {
                string content = data.ToJson();

                var normalizedProxyClass  = proxyClass.ToString().ToLower();
                var tempProxyListFilePath = String.Format(tempProxyListFilePathFormat, normalizedProxyClass);
                lock (locker)
                {
                    File.WriteAllText(tempProxyListFilePath, content);
                }
            }
            catch { }
        }
예제 #2
0
        private static void WriteMasterContent(SpinProxiesRootResponse data, SpinProxiesProxyClass proxyClass, bool writeOriginalFile = true)
        {
            string content = data.ToJson();

            var normalizedProxyClass    = proxyClass.ToString().ToLower();
            var masterProxyListFilePath = String.Format(masterProxyListFilePathFormat, normalizedProxyClass);

            lock (locker)
            {
                File.WriteAllText(masterProxyListFilePath, content);

                if (writeOriginalFile)
                {
                    var projectMasterProxyListFilePath = $"../../../{masterProxyListFilePath}";
                    if (File.Exists(projectMasterProxyListFilePath))
                    {
                        File.WriteAllText(projectMasterProxyListFilePath, content);
                    }
                }
            }
        }