I wrote it for the smart phone in the early year (2004.06 ,now I am quit this game), so this code is ugly, but it does work.
Note: the managed code only for test.
bug report in this post.
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
This forum has been made read only by the site admins. No new threads or comments can be added.
I wrote it for the smart phone in the early year (2004.06 ,now I am quit this game), so this code is ugly, but it does work.
Note: the managed code only for test.
bug report in this post.
Well done. ![]()
good!it's so perfect!
good code...
xpherion
Nice, but (I haven’t looked thought all the code yet, but from what I see) your program tries to open a file on the local system. This is fine, except that if it is running as a partially trusted app it will throw a security error. The way around this is to open an Open File Dialog box and use the get the stream, not the file name to open the file. Same thing with saving (only use the Save File Dialog).
Programous wrote:Nice, but (I haven’t looked thought all the code yet, but from what I see) your program tries to open a file on the local system. This is fine, except that if it is running as a partially trusted app it will throw a security error. The way around this is to open an Open File Dialog box and use the get the stream, not the file name to open the file. Same thing with saving (only use the Save File Dialog).
resolve method:
run regedit.exe (or programming to modify register, in run time), makes our app be a fully trusted app.
another way:
find 'RunAs' key in the register and delete it all.
leighsword wrote:
Programous wrote: Nice, but (I haven’t looked thought all the code yet, but from what I see) your program tries to open a file on the local system. This is fine, except that if it is running as a partially trusted app it will throw a security error. The way around this is to open an Open File Dialog box and use the get the stream, not the file name to open the file. Same thing with saving (only use the Save File Dialog).
this bug is an OS bug, not mine, the bug also is out of our control, the OS should not allow users to running my app as a partially trusted app.
Tensor wrote:
leighsword wrote:
Programous wrote: Nice, but (I haven’t looked thought all the code yet, but from what I see) your program tries to open a file on the local system. This is fine, except that if it is running as a partially trusted app it will throw a security error. The way around this is to open an Open File Dialog box and use the get the stream, not the file name to open the file. Same thing with saving (only use the Save File Dialog).
this bug is an OS bug, not mine, the bug also is out of our control, the OS should not allow users to running my app as a partially trusted app.
Does anyone else find this as hilarious as me?
BUG: Wont work unless run in full trust.
FIX: Run in full trust.
leighsword wrote:the OS should not allow users to running my app as a partially trusted app.
leighsword wrote:
Programous wrote: Nice, but (I haven’t looked thought all the code yet, but from what I see) your program tries to open a file on the local system. This is fine, except that if it is running as a partially trusted app it will throw a security error. The way around this is to open an Open File Dialog box and use the get the stream, not the file name to open the file. Same thing with saving (only use the Save File Dialog).
this bug is an OS bug, not mine, the bug also is out of our control, the OS should not allow users to running my app as a partially trusted app.
Sven Groot wrote:
leighsword wrote:the OS should not allow users to running my app as a partially trusted app.
You should demand the appropriate permissions at assembly level to prevent an app from being run with insufficient permissions. If you don't tell the OS what permissions you require, you can't really expect it to guess can you?
In this case, you need FileIOPermission, so you should do:
[assembly: FileIOPermission(SecurityAction.RequireMinimum, Unrestricted=true)]
leighsword wrote:
Sven Groot wrote:
leighsword wrote: the OS should not allow users to running my app as a partially trusted app.
You should demand the appropriate permissions at assembly level to prevent an app from being run with insufficient permissions. If you don't tell the OS what permissions you require, you can't really expect it to guess can you?
In this case, you need FileIOPermission, so you should do:
[assembly: FileIOPermission(SecurityAction.RequireMinimum, Unrestricted=true)]
well,it's my mistake, this is not an OS bug,but it absolutely is an .Net framework bug, and i hope this bug will be fixed in .net 2.0 .
why we need to write extra statements to fix a MS bug in our apps,is it really need?
old chinese told us, '画蛇添足'.
画蛇添足 (hua4 she2 tian1 zu2)(draw+snake+add+foot)
- Literally: adding legs when painting a snake
- Moral: Don't overdo something.
- English equivalent: to gild the lily