diff --git a/v2rayN/v2rayN/Forms/MainForm.cs b/v2rayN/v2rayN/Forms/MainForm.cs
index e07386bf..5add9efd 100644
--- a/v2rayN/v2rayN/Forms/MainForm.cs
+++ b/v2rayN/v2rayN/Forms/MainForm.cs
@@ -887,9 +887,9 @@ namespace v2rayN.Forms
                 ClearMsg();
             }
             this.txtMsgBox.AppendText(msg);
-            if (!msg.EndsWith("\r\n"))
+            if (!msg.EndsWith(Environment.NewLine))
             {
-                this.txtMsgBox.AppendText("\r\n");
+                this.txtMsgBox.AppendText(Environment.NewLine);
             }
         }
 
diff --git a/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs b/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs
index 57d4f564..511c654b 100644
--- a/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs
+++ b/v2rayN/v2rayN/Handler/RoutingRuleHandler.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 using System.Text.RegularExpressions;
 
 namespace v2rayN.Handler
@@ -42,7 +43,7 @@ namespace v2rayN.Handler
                 {
                     continue;
                 }
-                string value = str.Replace("\",", "").Replace("\"", "").Replace(",", "").Replace("\r\n", "").Replace(" ", "");
+                string value = str.Replace("\",", "").Replace("\"", "").Replace(",", "").Replace(Environment.NewLine, "").Replace(" ", "");
                 lstPac.Add(value);
             }
 
diff --git a/v2rayN/v2rayN/Tool/Utils.cs b/v2rayN/v2rayN/Tool/Utils.cs
index 46f1cec8..cff43678 100644
--- a/v2rayN/v2rayN/Tool/Utils.cs
+++ b/v2rayN/v2rayN/Tool/Utils.cs
@@ -155,7 +155,7 @@ namespace v2rayN
             {
                 if (wrap)
                 {
-                    return string.Join(",\r\n", lst.ToArray());
+                    return string.Join("," + Environment.NewLine, lst.ToArray());
                 }
                 else
                 {
@@ -176,7 +176,7 @@ namespace v2rayN
         {
             try
             {
-                str = str.Replace("\r\n", "");
+                str = str.Replace(Environment.NewLine, "");
                 return new List<string>(str.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries));
             }
             catch
@@ -214,8 +214,8 @@ namespace v2rayN
             try
             {
                 plainText = plainText.TrimEx()
+                  .Replace(Environment.NewLine, "")
                   .Replace("\n", "")
-                  .Replace("\r\n", "")
                   .Replace("\r", "")
                   .Replace(" ", "");
 
@@ -854,7 +854,7 @@ namespace v2rayN
 
                 SwWrite.WriteLine(string.Format("{0}{1}[{2}]{3}", "--------------------------------", strTitle, DateTime.Now.ToString("HH:mm:ss"), "--------------------------------"));
                 SwWrite.Write(strContent);
-                SwWrite.WriteLine("\r\n");
+                SwWrite.WriteLine(Environment.NewLine);
                 SwWrite.WriteLine(" ");
                 SwWrite.Flush();
                 SwWrite.Close();