Change for bug #1581, using FileShare.Read instead of FileShare.ReadWrite to prevent the error that was reported.

This commit is contained in:
RKrom 2013-12-17 16:04:19 +01:00
commit 62bae466ae

View file

@ -35,7 +35,7 @@ namespace Greenshot.IniFile {
*/
public static Dictionary<string, Dictionary<string, string>> read(string path, Encoding encoding) {
Dictionary<string, Dictionary<string, string>> ini = new Dictionary<string, Dictionary<string, string>>();
using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 1024)) {
using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 1024)) {
using (StreamReader reader = new StreamReader(fileStream, encoding)) {
Dictionary<string, string> nameValues = new Dictionary<string, string>();
while (!reader.EndOfStream) {