|
Hi, I'm using the following code to get the Machine name in an app
System.Environment.MachineName
On most computers this works fine but on one of our testers computers (machine is a windows 2000 desktop pc, not a networking share either), it's throwing the following exception.
Request for the permission of type System.Security.Permissions.EnvironmentPermission, mscorlib, Version = 1.0.50000.0, Culture = neutral, publicKeyToken = blahblahblah failed.
I have no idea what is causing this. I tried messing around with the .Net Configuration. Figured mscorlib didn't have permission rights.
also.........
I can't get any computer information in general. Trying to do some WMI core queries as well from code and getting a "Security Error" Exception. Below is the code that gets the disk size.
public string GetsDiskSize(){
ManagementClass cimobject;
ManagementObjectCollection moc;
cimobject = new ManagementClass("Win32_DiskDrive");
moc = cimobject.GetInstances();
try { // BIOS INFO
foreach(ManagementObject mo in moc){
this.m_sDiskSize = GetSystemValue("Size",mo);
mo.Dispose();
break;
}
}
catch(Exception ex){
System.Windows.Forms.MessageBox.Show("GetsDiskSize " + ex.Message);
cimobject.Dispose();
moc.Dispose();
return ex.Message;
}
cimobject.Dispose();
moc.Dispose();
return this.m_sDiskSize;
}
|
|
|
|
|
Hi,
Try using
[ Assembly:EnvironmentPermission(SecurityAction.Assert)]
attribute for your class...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
|
Decided to make the jump and have my next product be entirely .NET, and want to try to utilize best practices throughout.
One thing that sounds promising is the Enterprise Instrumentation Framework, several of the .NET application blocks build on or interface with it. But I can't find any overview guide, just the help file and a few webcast type things on MSDN. It seems strange... does anyone know if there is a guide out there that I just can't find like for the other application blocks?
Thanks!
|
|
|
|
|
If any one knows about install shield please help!
I am using Install shield developer 8 SP2 evaluation. I need to create setup such that it checks for the version of IE6, updates if necessary and reboot. After reboot the setup continues in the normal fashion. Then it checks for DotNet Framework 1.1 and MDAC 2.8, Install in necessary. If os is win 98/ME it should reboot before continuing in the same manner as above.
Please assist,
Its Urgent.
Regards,
Rahul.
|
|
|
|
|
i think ur question would be better suited on the InstallShield forums over at their website. Surely they have forums?
|
|
|
|
|
Hello ..
I am Omar Ismal from Egypt
I think that what you need are existing options in the installshield ..
The advantage you will have in installshield is its nice new XP interfaces but if you failed to find it
I advise you to use "Inno Setup" or "Setup Factory"
- Inno setup is more controllable because you write its script using PASCALE language so you can search for the .Net FrameWork by your self as a folder in the program files or search for the .Net framework Registry key
- in Setup Factory these are options you can do it by the wizard
I did the two samples before if you are interested send me again and i will send you the samples
But I wanna know from you what the .Net application needs to work in Windows 98 environment known that IE6 is installed and the .NetFrameWork installed ?
|
|
|
|
|
Hi,
My problem is as follow:
I want to show a dialogbox in Modeless mode from a callback function which is registered for an event with my own-defined eventhandler. This event handler maintains a queue and processes on the FIFO basis. I am using following code for creating/showing dialogbox:
Testing ss = new Testing(); // Where Testing is tht Dialogbox class
ss.Visible = true;
ss.Show();
ss.Focus();
ss.Refresh();
But what I get is a NotResponding form which is not even completely drawn. The content of the dialog box (buttons) are also not drawn on it.
If I use the same code from any other method of the class for instance Main(), this dialogbox shows up properly and works fine in modeless mode. Also, when I make this dialogbox modal in the callback function, it works fine. I have also tried making this dialogbox instance global but din work.
Can some one help me in this regrad?
Thanks
Bilal Farooq
Bilal Farooq
|
|
|
|
|
Hi,
As far as I guess this is happening because .Show() method is not a blocking call. Thatz why the control doesn't remain in the new form. Before the form gets completely painted the control of the application comes back to the place from where it had called the new form and continues execution.
The probable solution may be ,
a) Make the form a modal dialog.
b) Execute the queue related stuff in a seperate thread and use inter thread notification to invoke the modeless dialog from the main thread.
Hope this helps you...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
Thanks a lot for help.
I'll try this second solution because modeless dialogbox is my requirement
Thanks
Bilal Farooq
|
|
|
|
|
Hi,
I wish to develop a control ( or know of any such existing control) which works similar to the SQL Server table's data entry sheet.
to be more elaborate:
i will be specifying number of colums for that control.
2 rows with those many columns appears.
i fill in the data. and when i start filling the 2nd row
a 3rd empty row should appear.
|
|
|
|
|
hi,
I guess you can use GridView control for doing the same job without reinventing the wheel. Instantiate GridView control with the specified number of rows and columns. You can go thru the article :
http://www.c-sharpcorner.com/Code/2002/May/EditableGridView.asp
You may also use DataGrid control for doing the same. I guess itz editable by default.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
I am invoking VB.NET compiler on the fly to create an assembly in memory and then executing the methods from it. It works fine if I give Full Trust to code execution in .NET security config.
I would appreciate if anyone can point to an info on how to configure .NET and what I should do in my assembly to give Full Trust only to it but not all code on the machine.
In other words - what is the minimum I(developer) and administrator should do to allow my in-memory assembly to run?
I saw a lot of articles on this but they all talk about strond names and importing them from a file (exe or dll) to a new security group etc. I do not have the file and every time my assembly is created fresh in memory.
Thanks in advance
VRubins
|
|
|
|
|
|
hi,
you can try this:
[assembly:ReflectionPermission(SecurityAction.RequestMinimum, ReflectionEmit=true)]
[assembly:SecurityPermission(SecurityAction.RequestMinimum, SerializationFormatter=true)]
Write this before the class declaration. If you need more info on this look into .NET Quickstarts and look for
How Do I...Request the permissions my code needs?
in the "How Do I...?" section.
this might solve your problem.
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
1) When we launch .Net exe(Managed code) and un-managed old exe how OS know how to launch .net exe in CLR
2) What is the advantage of APPDOMAIN other than consumption of low memory
|
|
|
|
|
1) The PE headers tell the OS that.
2) AppDomain has security advantages - no managed code will access code in a different appdomain than their own, unless you explicitly enable them to.
There are only 10 kinds of programmers - those who understand binary, and those who don't.
|
|
|
|
|
Please help! I am new to VC++ and have no idea where to start. I have VB.NET DLL that I need to call from an existing VC++.NET App. How can I do this?
|
|
|
|
|
1. Add a reference in your C++.NET project to your VB.NET Project (if in same solution) or the .dll itself if not part of the same solution.
2. Make sure you use the compiler switch /clr when compiling the C++ project.
3. In your code you might want to add a #using statement followed by the namespace of your VB.NET dll.
4. Then to create a new instance of something defined in your VB.NET dll, say you defined a Foo class do this:
__gc Foo myFoo = new Foo();<br />
<br />
myFoo.DoSomething();
There is a little more to it, but msdn.microsoft.com has plenty of info on this. This post is all from memory, but it is the gist of it.
Good luck.
R.Bischoff
.NET, Kommst du mit?
|
|
|
|
|
I am trying to write a simple plugin using C++ but all the examples that i found were written in C#.
Does anyone have a C++ plugin sample that I can use to start with? Thanx a lot
|
|
|
|
|
|
How do i get the subnet mask configured on a m/c using the .NET framework?
Thanks.
Chen Venkataraman
|
|
|
|
|
Ok, I am using Visual Studio .NET & .NET Framework 1.0, and I want to upgrade it to .NET 1.1.
I've already downloaded and installed the .NET Framework 1.1 redistribute package, but VS .NET doesn't seem to recognized the new verison and I am not able to use System.Windows.Forms.FolderBrowserDialog which is only supported in 1.1 version.
Help please!
Thanks!
|
|
|
|
|
VS.NET 2002 can only target the .NET Framework 1.0
to target .NET Framework 1.1 you need to have VS.NET 2003
|
|
|
|
|
After purchasing and installing Win 2000 Professional and VS .NET Studio 2002 Academic some time ago, I was able to create Web projects as long as they were placed in thec:\Inetpub\wwwroot directory (i.e. a mapping existed between that directory and the url http://localhost). I was never able to install the IIS 5 Snap In from Win 2000 Professional so I never was able to configure other virtual directories. Recently, I converted my file system to NTFS as a prelim to upgrading to VS Studio .NET 2003 Professional. After the conversion I cannot run or create Web apps with VS .NET Studio 2002 because the mapping with the "default website" does not exist. Does anyone know a way arround this short of dealing with MS Support?
Gary at home
|
|
|
|