开发者

Is "login.ini" a reserved name?

开发者 https://www.devze.com 2023-02-17 16:37 出处:网络
I store the MRU of logins to my application in a file called login.ini and I save it in widnows application folders.

I store the MRU of logins to my application in a file called login.ini and I save it in widnows application folders.

I noticed that on some systems — I don't know why; I cannot find a common cause — the user cannot create the file, whereas it creates all other files in the same folder.

The only reason I can think of is that some antivirus/windows setting/... doesn't allow this particular user to create the file on this system.

I solved the problem by renam开发者_运维问答ing the file and it seems ok, but I'd like to be sure. Does anyone know more?

Note for bounty:

This is a related question I asked that details a little more what I am doing.


A little Google-fu turns up that other Windows developers have sucessfully created login.ini for their programs, and others use it in a third-party Windows login management program, so I would expect that its "reservedness" is partially dependent on its location in the file system (i.e. in the system files). However, I don't think the name "login.ini" is a system-wide reserved name, no.

I think you're right - certain antivirus programs MAY be messing with the creation of that file, as it is a fairly likely candidate imho for a virus filename. It looks as if it may already have been used for that purpose somewhere (apparently outside of the US), tho don't quote me on that.

So, if a different name works for you, I'd go with that. :)


Anti-virus is a definite possibility for messing with your file. Stuff like that happened all the time to me when I was using Norton.
'login.ini' is not a system-wide reserved name, it would only mess things up with the OS if you had it in the (assuming your drive is C:) C:\WINDOWS or C:\WINDOWS\System32 directories.
If you just have the file in an application files directory (like C:\Program Files or C:\All Users\Application Settings and such) it shouldn't interfere with the system.
If you determine that anti-virus is a definite problem, you could change the name to something like loginData and maybe make up a new file extension if you want to (assuming you are just going to read the file from a program, where the extension doesn't matter. otherwise stick to a recognized file extension)

0

精彩评论

暂无评论...
验证码 换一张
取 消