|
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
|
|
|
|
|
You have probably disabled session state for the page. Check the properties for the page.
By the way, why are you taking the value from the session variable, converting it to a string, and then back to an integer? Isn't the value you put in the session variable an integer? Just check if the data type is correct and then cast it.
---
b { font-weight: normal; }
|
|
|
|
|
Hey
My page header looks like this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="communityReplys.aspx.cs" Inherits="community_communityReplys" %>
But i am inherting from a base class that are in hearting from system.web.UI.page but i havent set enny settings regarding sessions?
|
|
|
|
|
I have notice that its my cs file that is my basePage class that are getting the exception? cant i get the session variable in the my basePage.cs that inherits from web.page?
All my webpages(aspx) is inherited from my basePage.cs and that have workt fine, but the sessions dont simes to work in the cs file?
|
|
|
|
|
Current issue is making me crazy at the moment, there must be something I missed, 'cause it's not working as expected...
I like to access a hash table key either by it's name or a class instance. To achieve this I create a new class (HashKey) which internally has a string called _name. When the hashtable calls HashKey.GetHashCode() it returns the HashCode of the internal wrapped string _name. Should be pretty much the same like I would use a literal string value key directly, right?
so it must the be same if I add my value by a string key
HashTable myHashTable = new HashTable();
myHashTable.Add("keyName", 4);
or I add my value by a string key wrapped in HashKey class.
HashKey myHashKey = new HashKey("keyName");
myHashTable.Add(myHashKey, 4);
Now I should/wanna be able to read the value by literal string or by the HashKey instance.
object value = myHashTable["keyName"];
value = myHashTable[myHashKey];
This doesn't work, but WHY?
Here is the implemenation of HashKey class, which wraps the string and overrides GetHashCode and Equals methods.
public class HashKey
{
private string _name;
public HashKey(string name)
{
_name = name;
}
public override string ToString()
{
return _name;
}
public override int GetHashCode()
{
return _name.GetHashCode();
}
public override bool Equals(object obj)
{
return _name.Equals (obj);
}
}
|
|
|
|
|
I copied your code and stepped through the debugger, and this is the solution, it works:
public override bool Equals(object obj)
{
if (obj is HashKey)
return _name.Equals(((HashKey)obj)._name);
else
return _name.Equals(obj);
}
You need to cast the object when necessary and access the _name attribute directly.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Greeeg,
Thanks for your fast reply, just added your code.
Now it works to access the key with the HashKey instance
value = myHashTable[myHashKey];
but this scenario still doesn't work here
object value = myHashTable["keyName"];
Any other changes you made to the code, any ideas?
myMsg.BehindDaKeys = "Jerry Maguire";
|
|
|
|
|
Strange, both work for me
Hashtable myHashTable = new Hashtable();
HashKey myHashKey = new HashKey("keyName");
myHashTable.Add(myHashKey, 4);
value = myHashTable["keyName"];
value = null;
value = myHashTable[myHashKey];
after both calls "value" is 4. I inserted the "value = null" to see whether the second call will change "value" at all.
You might want to add another if-clause like else if(obj is String) return _name.Equals((String)obj) into the Equals method.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
It doesn't work for me. I think it can't work because in case of asking
value = myHashTable["keyName"];
string.Equals() is called which is can never returns true when asked about equality with HashKey instance, right?
myMsg.BehindDaKeys = "Jerry Maguire";
|
|
|
|