diff --git a/src/ST.Client/Services/Implementation/HostsFileServiceImpl.cs b/src/ST.Client/Services/Implementation/HostsFileServiceImpl.cs
index 3b61eb467..4ef72e0d8 100644
--- a/src/ST.Client/Services/Implementation/HostsFileServiceImpl.cs
+++ b/src/ST.Client/Services/Implementation/HostsFileServiceImpl.cs
@@ -107,11 +107,6 @@ namespace System.Application.Services.Implementation
return false;
}
}
- if (fileInfo.IsReadOnly)
- {
- message = AppResources.FileAttributeIsReadOnlyModifyFail;
- return false;
- }
//if (fileInfo.IsReadOnly&&(OperatingSystem2.IsMacOS || (OperatingSystem2.IsLinux && !s.IsAdministrator)))
//{
// var editPath = Path.Combine(IOPath.CacheDirectory, "hosts");
@@ -132,12 +127,11 @@ namespace System.Application.Services.Implementation
}
if (checkReadOnly)
{
- var attr = fileInfo.Attributes;
- if (attr.HasFlag(FileAttributes.ReadOnly))
+ if (fileInfo.IsReadOnly)
{
try
{
- fileInfo.Attributes = attr & ~FileAttributes.ReadOnly;
+ fileInfo.IsReadOnly = false;
}
catch (Exception)
{
diff --git a/src/ST.Client/UI/Resx/AppResources.Designer.cs b/src/ST.Client/UI/Resx/AppResources.Designer.cs
index d2dc99981..1eb0e9b22 100644
--- a/src/ST.Client/UI/Resx/AppResources.Designer.cs
+++ b/src/ST.Client/UI/Resx/AppResources.Designer.cs
@@ -1536,7 +1536,7 @@ namespace System.Application.UI.Resx {
}
///
- /// 查找类似 文件属性为只读,修改失败 的本地化字符串。
+ /// 查找类似 文件属性为只读,修改失败,你可以尝试先备份该文件后删除再重试一遍 的本地化字符串。
///
public static string FileAttributeIsReadOnlyModifyFail {
get {
diff --git a/src/ST.Client/UI/Resx/AppResources.en.resx b/src/ST.Client/UI/Resx/AppResources.en.resx
index ef5041bda..c38ea0ad3 100644
--- a/src/ST.Client/UI/Resx/AppResources.en.resx
+++ b/src/ST.Client/UI/Resx/AppResources.en.resx
@@ -2173,10 +2173,6 @@
Announcement notification
Comment=;Author=MicrosoftTranslator
-
- The file property is read-only and the modification fails
- Comment=;Author=MicrosoftTranslator
-
The file size is too large
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.es.resx b/src/ST.Client/UI/Resx/AppResources.es.resx
index 0038a7020..d4557c318 100644
--- a/src/ST.Client/UI/Resx/AppResources.es.resx
+++ b/src/ST.Client/UI/Resx/AppResources.es.resx
@@ -2173,10 +2173,6 @@
Notificación de anuncio
Comment=;Author=MicrosoftTranslator
-
- La propiedad file es de sólo lectura y se produce un error en la modificación
- Comment=;Author=MicrosoftTranslator
-
El tamaño del archivo es demasiado grande
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.it.resx b/src/ST.Client/UI/Resx/AppResources.it.resx
index 8b084a353..05746781e 100644
--- a/src/ST.Client/UI/Resx/AppResources.it.resx
+++ b/src/ST.Client/UI/Resx/AppResources.it.resx
@@ -2173,10 +2173,6 @@
Notifica annuncio
Comment=;Author=MicrosoftTranslator
-
- La proprietà del file è di sola lettura e la modifica non riesce
- Comment=;Author=MicrosoftTranslator
-
Le dimensioni del file sono troppo grandi
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.ja.resx b/src/ST.Client/UI/Resx/AppResources.ja.resx
index 595cf523a..062ff9832 100644
--- a/src/ST.Client/UI/Resx/AppResources.ja.resx
+++ b/src/ST.Client/UI/Resx/AppResources.ja.resx
@@ -2169,10 +2169,6 @@
お知らせのお知らせ
Comment=;Author=MicrosoftTranslator
-
- ファイルの属性が読み取り専用のため、修正に失敗
- Comment=;Author=MicrosoftTranslator
-
ファイルサイズが大きすぎる
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.ko.resx b/src/ST.Client/UI/Resx/AppResources.ko.resx
index 338135dda..c47738377 100644
--- a/src/ST.Client/UI/Resx/AppResources.ko.resx
+++ b/src/ST.Client/UI/Resx/AppResources.ko.resx
@@ -2169,10 +2169,6 @@
공지 사항
Comment=;Author=MicrosoftTranslator
-
- 파일 속성이 읽기 전용이며 수정에 실패했습니다
- Comment=;Author=MicrosoftTranslator
-
파일 크기가 너무 큽니다
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.resx b/src/ST.Client/UI/Resx/AppResources.resx
index 00b3b5824..b5d6acea0 100644
--- a/src/ST.Client/UI/Resx/AppResources.resx
+++ b/src/ST.Client/UI/Resx/AppResources.resx
@@ -1797,7 +1797,7 @@ AAAAA-BBBBB-CCCC3
下载更新包失败,请稍后重试
- 文件属性为只读,修改失败
+ 文件属性为只读,修改失败,你可以尝试先备份该文件后删除再重试一遍
文件大小过大
diff --git a/src/ST.Client/UI/Resx/AppResources.ru.resx b/src/ST.Client/UI/Resx/AppResources.ru.resx
index 27f0df4f4..4c1d01d1f 100644
--- a/src/ST.Client/UI/Resx/AppResources.ru.resx
+++ b/src/ST.Client/UI/Resx/AppResources.ru.resx
@@ -2169,10 +2169,6 @@
Уведомление о объявлении
Comment=;Author=MicrosoftTranslator
-
- Свойства файла доступен только для чтения, и изменение завершается неудачей
- Comment=;Author=MicrosoftTranslator
-
Размер файла слишком большой
Comment=;Author=MicrosoftTranslator
diff --git a/src/ST.Client/UI/Resx/AppResources.zh-Hant.resx b/src/ST.Client/UI/Resx/AppResources.zh-Hant.resx
index 26068a2e9..e7acd61eb 100644
--- a/src/ST.Client/UI/Resx/AppResources.zh-Hant.resx
+++ b/src/ST.Client/UI/Resx/AppResources.zh-Hant.resx
@@ -2169,10 +2169,6 @@
公告通知
Comment=;Author=MicrosoftTranslator
-
- 文件屬性為只讀,修改失敗
- Comment=;Author=MicrosoftTranslator
-
文件大小過大
Comment=;Author=MicrosoftTranslator