|
Yeah, umm...notepad.exe is NOT a managed application, i.e. it has no "components". If Form.FromHandle even works (in essense, it's just a wrapper for a frames HWND), the components (or Controls ) collection won't contain anything.
At the very most, you could find all child HWNDs and try to associate them with their respective wrapper classes, but this is not a good idea.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
How can I adjust my IE .NET sandbox security level?
Sergiu.
|
|
|
|
|
In your administrative tools folder (in the Control Panel), use the Microsoft .NET Framework Configuration or Microsoft .NET Framework 1.1 Configuration.
Also, it's best to leave the defaults alone but add specific code groups to the appropriate policy (Enterprise, Machine (usually), and User).
Tip: for code to be run off the Internet via Internet Explorer (and touchless deployment), you can only use host evidence in your membership conditions (Site, Url) because IEExec doesn't gather assembly evidence like X.509 certificates and what-not.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Did you used .NET Framework 1.0 before? I think I got out of the sendbox with a my custom control. I ran this code and it works (and I think it shouldn't work):
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
OpenFileDialog dialog = new OpenFileDialog();<br />
if(dialog.ShowDialog() == DialogResult.OK)<br />
{<br />
System.IO.StreamReader r = new System.IO.StreamReader(dialog.OpenFile());<br />
MessageBox.Show(r.ReadToEnd());<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.StackTrace);<br />
}<br />
}<br />
I opened a file from the disk.
Sergiu.
|
|
|
|
|
Yeah, I'm a software architect and have done research deep into the frameworks.
It depends from where you're running your code. If you're running it locally, local assemblies have FullTrust which means they can do anything. From a network share, some things are allowed. Just look at the code group - taking into account the appropriate membership conditions - and you'll see what is and what isn't allowed.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
when i use = operator some times i have strange result :
sometimes it sets the value of object to anothre one and some times it set the refrence of an object to the other
so did any body knows how can i detarmine when it happen as example when i create a new class A inharits from ArrayList the instances of ojcets sets by value and if you use other classes the setting operator will use the reference .!!??
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The behaviour of the assignment operator ( = ) differs between reference types and value types.
References types are types defined with the class keyword, and value types are the types defined with the struct keyword. All "simple" types in C# are value types, except for string which is a reference type.
Sample with value types:
int a = 10;
int b = a; Results in a and b beeing two seperate copies of the number 10.
Sample with reference types:
ArrayList a = new ArrayList();
ArrayList b = a; Results in a and b beeing two pointers to the same ArrayList object.
Have a look at my latest article about Object Prevalence with Bamboo Prevalence.
|
|
|
|
|
Dear sir,
i am sorry to tell you that you are not true so if you try the second sample (ArrayList) which you write you will find that the assignment had done by value not by referenc
just try it , if you make any changes in b it won't reflected to a which mean that this assignment have done by value
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The code sample beneath show that the ArrayLists a and b are in fact the same ArrayList.
ArrayList a = new ArrayList();
ArrayList b = a;
a.Add("Hello");
b.Add("World");
foreach(string s in a)
{
Console.WriteLine(s);
}
Have a look at my latest article about Object Prevalence with Bamboo Prevalence.
|
|
|
|
|
Sorry i have i mistake in my code ....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
You have a lot of nerve! The first reply is correct. You are the one asking the question which means you are the one that doesn't understand. The problem is reference types vs. value types.
If you would actually read the .NET Framework SDK you might understand. And where you're most confused is that while ArrayList is a reference type, any value types (i.e. Int32 , Enum , etc.) stored in the ArrayList are still value types and store a value - not a reference, and hence changing one won't change another.
See http://msdn.microsoft.com/library/en-us/csref/html/vcrefTypesS.asp[^] for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
sory previosly i had a mistake in my code where i was using an array list but some where in the code i had used clone() method so so it is my falt.
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The problem that you are facing is nothing but, you are not instantiating the object value initially.
Simple eg:
int i;
Now is a varible. Ok. The value that is there in that i might be any garbage value( might be 0 or and number from the garbage collector). Ok.
if it is like this
int i = 0;
Now the value of i initially is 0.
I think the problem that you are facing is something of this kind.
Hope my solution is some what relevant to your problem?
See you,
Vishnu. A,
BIT,
UC.
Vish_For_You
|
|
|
|
|
dear sir ,
you did not know the problem , the problem is that when you assign any object to other one if the assigning get comes by references , any changes in any one of the variables will be change the other one becase they are the difrent reference to the same instance by the the assignment comes by value it won't happen .
so ..........
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Hi,
I want to seperate my toolbar buttons into 3 groups, therefore I hope to make 3 individual toolbars, and they must able to dock together under menubar and floatable when Drag it out.
If I need to make own toolbar control, how to do this? And I couldn't find any good example, could some experts help me, thank you ~~!
|
|
|
|
|
i've made a simple web server, but it cannot passing data from any script or form . I wanna know how to using ISAPI extension to pass the data from client to my web server. THX!! GBU!!!
|
|
|
|
|
First, wrong forum!
Second, you're ISAPI extension has to accept appropriate data from the form. See the article http://msdn.microsoft.com/msdnmag/issues/01/10/upload/default.aspx[^] for an example. There's some links at the bottom that discuss general ISAPI programming.
While the example is for files, the idea is similar (and more simple) for plain form data. Just like a GET query string that passes a key/value pairs separated by & and associated with =, POST query data is delimited in the same way but uses the content-type "multipart/form-data".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Linking database with C# was easy but the problem that I faced when I was working on my project was when the database and the program was is in local drive(C) and working, then I cut that and put it in my network folder.
After that when I again copy that and put it in c drive and run it, then the links are changed and again I had to put all the links again. That is a rediculous task.
Can any one provide solution for this?
Vish_For_You
|
|
|
|
|
Links? You mean connection strings and what-not? Put the connection string in your application configuration file (yourappname.exe.config) using the <appSettings> section (see the documentation for that element for more information) and use the System.Configuration.ConfigurationSettings.AppSettings to get it out. This is pretty much the common practice for both Windows and Web Forms.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That sounds helpful.
Thank you I will try that one and reply you.
Bye,
Vishnu. A,
BIT,
UC.
|
|
|
|
|
You know... some full screen windows program have those menu bar on top? if you press ESC it will hide and you press ESC again it will Unhide? I like that kinda style but then... I'm a super C#/programming n00b, I only started C# for like a week, I don't know syntax and everything, it would be cool if anyone can show me exact what I should do (I only know the part about adding the menu to the application form by double click the MainMenu in the ToolBox), to add code to make the menu hide and unhide with ESC key, I dunno that one =^^=
please help a n00b
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Look at the KeyDown event. There are other events that work similar, but this (or KeyUp ) is the easiest since you're passed the KeyCode that was pressed.
As far as how to do it, well, you're going to have to learn. In VS.NET, you can switch to the events tab in the Property Grid, find one of those events I mentioned and double-click it for a default name. Start reading the documentation for the KeyEventArgs that is passed and you'll even find some good examples.
Blindly fumbling through code and relying soly on IntelliSense won't teach you anything. Researching most definitely will and is required for good development skills. If you still can't figure it out, post to the forum what exactly is wrong (compile errors, exceptions thrown, etc.) but try to figure it out first. It's the only way to truly learn especially when you're a n00b.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Your post didn't help at all since I'm a n00b and there are too many topics about KeyEventArgs in the MSDN and there's no example that I was looking for.
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Well, there's only one way to learn, bubba. Start reading the topics in MSDN and start-off basic if you can't understand the "advanced" (even though it's not) stuff. Making guesses and asking others for complete examples won't teach you anything.
Here's a (rather thorough) tip, though: handle the KeyDown event and in the KeyEventArgs check if the KeyEventArgs.KeyCode property is set to KeyCode.Escape . Then either call Show or Hide on the Form . The only problem is that once the form is hidden, it won't receive keyboard events because it doesn't have the focus. So, you'll have to have another Window that is capable of showing the window again if the [ESC] key is pressed again.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
wha?? that's bullshit and so much trouble, I saw other programs made in C++, it doesn't look so hard and hassle, I start off with C# because I thought it's easier than C++, now I think C# is bullshit, so little examples to learn from and people aren't even helpful, there are tons of examples with C++ about that hide/show menu but I wanted it in C# but no examples....
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|