Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ini配置文件操作,没有ini文件生成 #93

Closed
obnews opened this issue Aug 4, 2023 · 2 comments
Closed

[BUG] ini配置文件操作,没有ini文件生成 #93

obnews opened this issue Aug 4, 2023 · 2 comments
Labels

Comments

@obnews
Copy link

obnews commented Aug 4, 2023

运行下列代码后,并没有ini文件产生,是我哪里操作错了吗?我是.NET 6

using Masuit.Tools.Files;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using static System.Collections.Specialized.BitVector32;

namespace ConsoleApp6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            INIFile ini = new INIFile("filename.ini");
            ini.IniWriteValue("section", "key", "value"); // 写值
        }
    }
}
@obnews obnews added the bug label Aug 4, 2023
@obnews obnews changed the title [BUG] ini配置文件操作 [BUG] ini配置文件操作,没有ini文件生成 Aug 4, 2023
@ldqk
Copy link
Owner

ldqk commented Aug 6, 2023

你没有传ini文件的绝对路径,这会导致filename.ini会生成到C:\Windows目录下去

@obnews
Copy link
Author

obnews commented Aug 6, 2023

你没有传ini文件的绝对路径,这会导致filename.ini会生成到C:\Windows目录下去

我改成这样可以了,非常感谢答疑。

INIFile ini = new INIFile(Environment.CurrentDirectory + "\\filename.ini");

但是之前那样在C:\Windows也找不到。

@ldqk ldqk closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants