|
If you want your app to automatically just work from a network share you need to design it so it doesn't require full trust
I need that in MDI child form Escape key closes form, Ctrl+F1 cycles and
Ctrl+F10 toggles maximizing. For this I use code below in form base class which requires full trust.
How to implement those features without full trust ?
Andrus.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Escape:
if (this != FormManager.MainForm)
{
Close();
return true;
}
break;
case Keys.Control | Keys.F1:
for (int i = 0; i < FormManager.MainForm.MdiChildren.Length; i++)
{
if (FormManager.MainForm.MdiChildren[i] == this)
{
if (i < FormManager.MainForm.MdiChildren.Length - 1)
FormManager.MainForm.MdiChildren[i + 1].Focus();
else
FormManager.MainForm.MdiChildren[0].Focus();
return true;
}
}
return true;
case Keys.Control | Keys.F10:
if (WindowState == FormWindowState.Maximized)
WindowState = FormWindowState.Normal;
else
WindowState = FormWindowState.Maximized;
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
Andrus
|
|
|
|
|
Handle the forms keypress or keydown events instead of overriding the ProcessCmdKey method. Use code in their to max/min/cycle your forms based on the key pressed.
Simon
|
|
|
|
|
|
Ahh...interesting.
Have you tried the _forms_ previewkeydown event? (You have to set keypreview to true)
Simon
|
|
|
|
|
|
Sorry then, I'm out of ideas. There should be a way though. Detecting a key press barely seems like something that should require full trust.
Simon
|
|
|
|
|
No, there are no ways.
Detecting those keypresses in winForms requires application to run in full trust mode.
Andrus
|
|
|
|
|
I ran with adminstrator rights in Vista
CasPol.exe -m -ag 1.2 -url file://z:/myapp/* FullTrust
C:\...crosoft.NET\Framework\v2.0.50727>g 1.2 -url file:
Microsoft (R) .NET Framework CasPol 2.0.50727.1434
Copyright (c) Microsoft Corporation. All rights reserved.
The operation you are performing will alter security policy.
Are you sure you want to perform this operation? (yes/no)
y
Added union code group with "-url" membership condition to the Machine level.
Success
However
z:\myapp\myapp.exe
still shows immediately
Myapp as stopped working
Andrus
|
|
|
|
|
Sorry, I've no idea about this. Try catching and logging exceptions at the top level to see what's going wrong.
Simon
|
|
|
|
|
Exception which occurs in does not show .NET Winforms unhandled exception dialog.
So this exception cannot be catched in .NET code.
Andrus
|
|
|
|
|
Hi!
There's a control panel for the configuration of .NET 2.0 if you have the SDK installed.
When you select "Runtime security policies" (I hope that's the correct name, I only have the German version here...) you get the option to evaluate a given assembly with respect to all the permissions this assembly is granted.
You could test your assembly to verify that the change in your security policy actually affects your application.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
|
Don't know, sorry.
Don't you have VS2005 installed? In that case, the .NET 2.0 SDK is already installed.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have Visual C# Express 2008 Installed.
I intalled "SDK Tools" from "Windows and .NET SDK" package but Control Panel does not show this utility.
Installer created 2 directories, v6.0a and v6.1 containing files with same names. I tried some executables in v6.1 directory but they appear to do other things.
Directory of C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin
31.07.2008 12:06 <DIR> .
31.07.2008 12:06 <DIR> ..
07.11.2007 12:01 72_688 al.exe
06.11.2007 21:53 140 al.exe.config
16.01.2008 17:21 40_960 apatch.exe
07.11.2007 12:01 913_416 aspnet_merge.exe
07.11.2007 12:01 58_360 AxImp.exe
16.01.2008 17:21 510_976 capicom.dll
16.01.2008 17:21 20_992 Cert2Spc.exe
16.01.2008 17:21 74_752 CertMgr.Exe
16.01.2008 17:21 30_208 checkv4.exe
07.11.2007 12:01 66_040 clrver.exe
16.01.2008 17:21 23_552 Consume.exe
07.11.2007 12:01 185_336 cordbg.exe
07.11.2007 12:01 72_192 CorFlags.exe
16.01.2008 17:21 60_416 ctrpp.exe
19.06.2006 14:09 247 dasmhlp.cnt
19.06.2006 14:09 21_963 DASMHLP.HLP
22.01.2008 12:11 58_360 disco.exe
31.07.2008 12:03 <DIR> en-us
07.11.2007 12:01 107_520 FUSLOGVW.exe
07.11.2007 12:01 106_496 gacutil.exe
06.11.2007 20:07 181 gacutil.exe.config
16.01.2008 17:21 132_608 genmanifest.exe
07.11.2007 12:01 31_744 guidgen.exe
07.11.2007 12:01 386_040 ildasm.exe
06.11.2007 20:07 181 ildasm.exe.config
11.12.2007 14:15 3_105 INSTLR1.ADM
11.12.2007 14:15 9_179 instlr11.adm
08.01.2008 17:19 596 isvtier5appsigningprivkey.dat
08.01.2008 17:19 148 isvtier5appsigningpubkey.dat
08.01.2008 17:19 21_234 isvtier5appsignsdk.cc
08.01.2008 17:19 4_916 isvtier5appsignsdk.xml
08.01.2008 17:19 56_994 isvtier5appsignsdk_client.xml
07.11.2007 12:01 46_064 lc.exe
07.11.2007 12:01 78_840 mage.exe
07.11.2007 12:01 463_864 mageui.exe
16.01.2008 17:21 123_904 make-shell.exe
16.01.2008 17:21 30_720 MakeCat.Exe
16.01.2008 17:21 57_856 makecert.exe
07.11.2007 12:01 111_608 Mdbg.exe
22.01.2008 12:11 376_832 MdbgCore.dll
22.01.2008 12:11 104_960 MdbgDis.dll
16.01.2008 17:21 170_496 MergeMod.Dll
07.11.2007 12:01 25_608 mgmtclassgen.exe
16.01.2008 17:21 88_576 Midl.Exe
16.01.2008 17:21 820_736 MidlC.Exe
07.11.2007 09:57 373_760 msdis160.dll
11.12.2007 14:15 2_184 msi.adm
16.01.2008 17:21 74_752 MsiCert.exe
16.01.2008 17:21 155_648 MsiDb.Exe
16.01.2008 17:21 73_728 MsiFiler.Exe
16.01.2008 17:21 98_816 MsiInfo.Exe
16.01.2008 17:21 65_536 MsiMerg.Exe
16.01.2008 17:21 68_096 MsiMsp.Exe
16.01.2008 17:21 73_728 MsiStuff.Exe
11.12.2007 14:15 16_516 MsiTool.Mak
31.07.2008 12:03 <DIR> msitools
16.01.2008 17:21 68_096 MsiTran.Exe
16.01.2008 17:21 1_455_104 MsiVal2.Msi
16.01.2008 17:21 113_664 MsiZap.Exe
16.01.2008 17:21 71_680 mspatchc.dll
08.01.2008 17:19 276 msrootpub1.dat
08.01.2008 17:19 276 msrootpub2.dat
16.01.2008 17:21 2_243_072 Orca.Msi
16.01.2008 17:21 270_336 patchwiz.dll
16.01.2008 17:21 43_008 perflibmig.exe
07.11.2007 12:01 37_888 PermCalc.exe
31.07.2008 12:06 <DIR> PermCalcCache
07.11.2007 12:01 79_360 PEVerify.exe
06.11.2007 20:07 181 PEVerify.exe.config
16.01.2008 17:21 28_160 pvk2pfx.exe
16.01.2008 17:21 58_368 ReBase.Exe
08.11.2007 01:26 201_752 RequiredPermissions.dll
07.11.2007 12:01 62_456 ResGen.exe
07.11.2007 12:01 50_176 SecUtil.exe
31.07.2008 12:00 20_936 SetEnv.Cmd
22.01.2008 12:11 54_264 sgen.exe
16.01.2008 17:21 112_128 signtool.exe
07.11.2007 12:01 95_728 sn.exe
06.11.2007 20:07 181 sn.exe.config
22.01.2008 12:11 46_080 SoapSuds.exe
03.05.2007 09:43 181 SoapSuds.exe.config
22.01.2008 12:11 22_024 SoapSudsCode.dll
16.01.2008 17:21 23_040 SpOrder.Dll
16.01.2008 17:21 27_648 SpOrder.Exe
07.11.2007 12:01 291_840 SqlMetal.exe
04.08.2007 12:43 156 SqlMetal.exe.config
11.12.2007 14:14 19_747 StartTools.htm
07.11.2007 12:01 41_984 StoreAdm.exe
21.06.2007 00:05 63_820 SvcConfigEditor.chm
17.10.2007 02:33 2_102_288 SvcConfigEditor.exe
21.09.2007 12:23 60_421 SvcTraceViewer.chm
22.01.2008 12:11 705_544 SvcTraceViewer.exe
22.01.2008 12:11 193_536 SvcUtil.exe
16.01.2008 17:21 93_184 tcpanalyzer.exe
08.01.2008 17:19 942 tcpanalyzer.exe.manifest
16.01.2008 17:21 226_816 tedutil.dll
07.11.2007 12:01 62_456 TlbExp.exe
07.11.2007 12:01 70_648 TlbImp.exe
16.01.2008 17:21 122_368 topoedit.exe
16.01.2008 17:21 21_504 Uuidgen.Exe
06.10.2007 03:18 54_264 WCA.exe
06.10.2007 03:19 62_456 WFC.exe
03.05.2007 09:43 1_777 WFC.exe.config
16.01.2008 17:21 329_728 WiLogUtl.exe
08.01.2008 17:19 27_344 windiff.chm
16.01.2008 17:21 187_904 WinDiff.Exe
07.11.2007 12:01 152_568 WinRes.exe
16.01.2008 17:21 860_160 wpfperf.msi
16.01.2008 17:21 238_592 wsatui.dll
22.01.2008 12:11 91_128 wsdl.exe
03.05.2007 09:43 181 wsdl.exe.config
16.01.2008 17:21 680_960 XAMLPad.exe
16.01.2008 17:21 4_655_616 xperf_x86.msi
22.01.2008 12:11 87_032 xsd.exe
07.11.2007 12:01 103_416 xsltc.exe
112 File(s) 23_370_811 bytes
5 Dir(s) 2_115_723_264 bytes free
Andrus
|
|
|
|
|
I'm afraid I don't know if this control panel is part of VS 2008 Express. With VS 2005 it's located at
C:\Programme\Microsoft Visual Studio 8\SDK\v2.0\Bin\mscorcfg.msc
Hope this helps...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
In C# Express 2008 I have folder
C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin
but this folder is empty.
Any idea how to use this tool ?
Andrus
|
|
|
|
|
Hi folks.
We have an application that uses remoting to communicate with our servers. Because we are adding new features very often we need to keep the clients up to date. It is my job to develop the auto updater.
I have a small problem with vista, though (at least I think so), because the updater would download zip packages from the server and extract the contents to the application folder. I fear Vista doesn't like this very much.
I'm searching for an elegant solution for this, one that doesn't bug the user. (And I guess I'm not the only one, but maybe I missed something on Dr. Google's)
Any ideas?
My current approach is:
When I set the requestedExecutionLevel to "requireAdministrator" in the manifest, but this ends in firing the UAC elevation dialog every time the updater runs, although there may be no update to do at all. Is there a way to elevate the process only when needed, i.e. when I try to create a file in the "Program Files" folder?
If I don't elevate the program at all, the access to "Program Files" gets virtualized. That's not exactly great for an updater.
Regards,
Markus
|
|
|
|
|
Hi!
Ah yes, the joys of UAC.
You could make the actual updater a seperate application and include the check if there's something to update into the application itself.
If your app finds an update, you can run the updater and thus only request elevated rights when needed.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I am using a tooltip for the treeview control.
The tooltip is used for the tree items inside the treeview control i.e. Parents and children.
The tooltip is populated as follows:
nodeParent.Nodes.Add("Error : " + ex.Message, "Error : " + ex.Message, imageFail;
nodeParent.Nodes["Error : " + ex.Message].Tag = "Error : " + ex.Message;
Question:
If there are two children under a parent, and you click on the 2nd child, this error occurs
Object reference not set for an instance of an object
Any thoughts please?
|
|
|
|
|
Hey guys
so one of the next controles i need to write is a calender like thing. Basically what it needs to do is insert, update and delete the rows of an intersection entity. Heres what the relationships look like(X is the many)
------------- ---------- ------------
| Shift |-----X | Roster |X------| Employee |
------------- ---------- ------------
The control will look like a calender and then the user can setup which shifts the employee works on which days.
The thing is i have no idea how to represent the data in this control, totaly clueless.
does anyone have any ideas?
Thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
You're confusing your self by thinking in database schemas. The roster is really a artificial entity, used only to prevent many to many relationships in the database, it doesn't need to be displayed to the user.
What you really have is each employee can work many shifts, and each shift can have many employees.
So you need two alternative views. 1 view allows the user to select an employee, and assign which shifts they work, and the other allows the user to select a shift, and assign which employees will work that shift. Depending on your use cases, you may only need one of these views. Of different types of users may need different views. (If for example, employees log in and select their own shifts, you could automatically just display data for the logged in employee)
Depending on number of employees/shifts you could have a drop down box to select the employee and tick boxes underneath to assign shifts. Or if you have a lot of shifts, maybe a list box of the shifts the employee is working, with add/remove buttons.
or the reverse, a simple calender control to select the shift, then a list of employees underneath with tick boxes.
I'm starting to ramble now . Hope I've given you some ideas.
Simon
|
|
|
|
|
Hey Simon
sorry for the late reply, ive been offline the last few days.
i understand what you mean completely, but im re-doing an existing system. the current interface for this roster is a calender type thing and changing that to a "simpler" interface would seem like a downgrade...?
Heres what happens in the current system...
After the user sets up employees and shifts a roster needs to be set up. Lets say that the employee works a 2week cycle, the user will then click the cell representing the 1st day of that cycle (an actual date on a calender), and assign the shift the employee should work that day. Then the next 13 days are set up on the same way. Then the user can select the 14days that were set up and copy them for how ever long the user wants to.
Hope all that makes sense
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: changing that to a "simpler" interface would seem like a downgrade
Don't get caught in the trap of thinking that complexity is better. Analyse your users requirements. Look at the use cases. Design something that meets the requirements, and makes the most common use cases easy to perform. It's not a downgrade if it does the job in the simplest possible way for the user.
HarveySaayman wrote: After the user sets up employees and shifts a roster needs to be set up. Lets say that the employee works a 2week cycle, the user will then click the cell representing the 1st day of that cycle (an actual date on a calender), and assign the shift the employee should work that day. Then the next 13 days are set up on the same way. Then the user can select the 14days that were set up and copy them for how ever long the user wants to.
Hope all that makes sense [Big Grin]
Yes. It sounds fine... Umm... What was your question?
Simon
|
|
|
|
|
it really absolutely has to be that way, unfortunately its not in my hands.
Simon Stevens wrote: What was your question?
still have no idea to represent the data in such a control... any ideas?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Is it the classes/structs behind - or the UI part of the control that you're struggling with?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|