|
no, you have to create another form then handle windows message to kill or set focus to the main and tool in the same time
|
|
|
|
|
Take a look here[^].
This docking framework is able to create floating tool bars.
Regards,
mav
|
|
|
|
|
Thanks a lot. It looks very useful, I will try it.
|
|
|
|
|
In global.asax I have:
<br />
protected void Application_AuthenticateRequest(Object sender, EventArgs e)<br />
{<br />
HttpApplication app = (HttpApplication) sender;<br />
<br />
if(app.Request.IsAuthenticated)<br />
{<br />
CustomPrincipal ppal = new CustomPrincipal( Context.User.Identity.Name.ToString(), ((CustomIdentity)Context.User.Identity).ProjectID );<br />
<br />
Context.User = ppal;<br />
}<br />
}<br />
But when I attempt to go to a page it throws a "Specified cast is not valid" on this line: CustomPrincipal ppal = new CustomPrincipal( Context.User.Identity.Name.ToString(), ((CustomIdentity)Context.User.Identity).ProjectID );
CustomIdentity is an IIdentity with some extra stuff in it.
What I am trying to do is have one web site that is a work flow managment program, but will encompas several projects. So on the login page you put in a username and password then select a project from a drop down list and it authenticates the user based on whether they have a role in this project (junction table). The project id needs to be readily available on a per user basis as every stored procedure has project id as a parameter so that only data relevent to the given project is displayed.
Is there a better way to handle this situation or a way to make Project id available from context as well as be nessesary to make a Principal or Identity object.
-- modified at 16:54 Tuesday 17th January, 2006
|
|
|
|
|
Is the object that Identity refers to really a CustomIdentity object? You can't cast an object to something that it isn't.
---
b { font-weight: normal; }
|
|
|
|
|
It should be as I can cast Context.User.Identity to CustomIdentity everywhere else in the program, but for some reason it isn't in global.asax... Regardless I managed to get it to work by using the Context.Cache.
|
|
|
|
|
Hi!
Is it possible to change the computer name and the workgroup using C#? I'm trying to put together a program that:
1. Creates three user accounts
2. Changes the name of the computer
3. Changes the name of the workgroup
So far I've been able to create the user accounts. Can someone help me with the last two?
Thanks in advance!
Matthew
|
|
|
|
|
|
When using this I find that any sub-properties, with the type string, don't refresh the parent after tabbing off the change. When a sub-property is an Enum or type like Font the parent gets refreshed. How or Can I get the parent to refresh from the change in a sub-property that is a string?
-- modified at 16:38 Tuesday 17th January, 2006
|
|
|
|
|
i need to secure an application using any hardware ID
thanx
Martyr
|
|
|
|
|
Hope this helps.
<br />
using System.Management;<br />
...<br />
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID='C:'");<br />
string volumeNumber= disk.Properties["VolumeSerialNumber"].Value.ToString();<br />
Cheers,
Simon
> blog:: brokenkeyboards
> my opinion of VS05 :: here
> CV :: PDF
> skype me! :: SimonMStewart
|
|
|
|
|
Even the volume serial number can be copied.
Try any app like Ghost and you can create an identical machine using the same VSN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: volume serial number can be copied
Granted, but he was looking for an answer to his question, not criticism of the idea.
Regarding your other comment, one of the ways of doing key generation / app licensing is to make sure you can reproduce the key at will to recheck the user-supplier key against the code generated one.
If you get fancy and use Guid.New or something similar, you'd have to store that on disk somehow to recheck the validity of the user's app.
Cheers,
Simon
> blog:: brokenkeyboards
> my opinion of VS05 :: here
> CV :: PDF
> skype me! :: SimonMStewart
|
|
|
|
|
Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Strt generating your own ID's 'cause getting them from the hardware is spotty at best. There is no standard that MUST be followed by all vendors for tagging their hardware.
I'm doing a "yes, but..." here.
OEM versions of Windows use the moboID to enforce only installing the licence on a single computer (if you mobo has to be replaced you need a new serial, oem versions are only half as expensive though). Presumably this means there's no easy way to change/spoof it, otherwise MS would've elected a different enforcement method.
|
|
|
|
|
Like I said, there is no reliable method of getting an ID off the motherboard, or any other device for that matter.
And, I've never had to get a new serial number for an OEM motherboard replacement. If you're talking about Windows XP's activation, there is no mobo ID in use. It gathers information from many different points in the system and registry to create a key. If the hardware changes too much, then the key breaks. But it does allow for limited changes in the system, like a replacement mobo, new hard drive, or changing out the video controller.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello All,
I am working on a school project; using c# to create a windows form application to modify Window's mouse cursor. I have tried many attempts using cursor class that MSDN provided. However, I was not successfully done what I'd like to do for this project.
I'd like to know if there is anyway that I can change the arrow cursor to my custom cursor out side the application form (When the application actively in the foreground or sit in the system tray)? I only able to change the cursor when the mouse is actively within the application form, but when I move the mouse to the desktop (outside the application form) it would change to a default window cursors.
Please let me know if I can change the window's mouse cursor permanently once my code is active or any alternative i.e.: change the registry keys to make this happen.
Many thanks,
Khanh.p
|
|
|
|
|
Once the cursor is over another program, it can change the cursor, so the answer is probably no.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Considering that those "other applications" may want to change the cursor for various UI hints and reasons, why would your cursor overide their cursor?? In general it is not good usibility alter cursors outside of your application. If you want to change a cursor for all applications use a theme.
|
|
|
|
|
This is only a School project, and I like to know if this is possible in anyway. I am not trying to overwrite any other applications. However, I might take a wrong approach for this project.
If not possible, I may need to reconsider my project.
Thanks for the reply All.
Khanh.p
|
|
|
|
|
hello,
I have a basic question since Im at the basic level of programming anything. how can I make the program fill out certain text boxes in an IE window and then submit them with a button on the website? so if there is "Name" then it puts the name in there, and if there is an "ok" button then it automatically submits it with the button?
thanks for the help
|
|
|
|
|
Any one can help how to create a netmodule
in VS IDE?? I can not find similar option as in command line .
Thanks thanks thanks...
|
|
|
|
|
That all depends on what your definition of a "netmodule" is. What do you want this thing to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey!
I am running Visual Studio 2005 professional.
I am now working on a webproject where i need to use sessions
I store sessions like this
<br />
Session.Timeout = 30;<br />
Session.Add("profileId", profileId);<br />
and im getting the sessions by this code:
<br />
try<br />
{<br />
if (Session["profileId"] != null)<br />
{<br />
mUserId = int.Parse(Session["profileId"].ToString());<br />
postMessage.Controls.Add(LoadControl("~/common/uc/loginBox.ascx"));<br />
}<br />
}<br />
catch (Exception ex) { throw (ex); }<br />
The problem is when we reach the if i get a error:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpmodules> section in the application configuration.
Any ide what i need to do? i havent had this problem before?
Best Regards
Jimmy
|
|
|
|
|
by default enablesessionstate is true. Incase it is false,you can enable sessionstate at page level by setting enablesessionstate of page directive to true.
Thanks
|
|
|
|