Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: TextBox: erasing the old lines Pin
Jeff Varszegi12-May-04 9:25
professionalJeff Varszegi12-May-04 9:25 
GeneralRe: TextBox: erasing the old lines Pin
leppie12-May-04 13:25
leppie12-May-04 13:25 
GeneralRe: TextBox: erasing the old lines Pin
Jeff Varszegi13-May-04 2:02
professionalJeff Varszegi13-May-04 2:02 
GeneralDebugging Pin
Anonymous12-May-04 9:00
Anonymous12-May-04 9:00 
GeneralRe: Debugging Pin
Jeff Varszegi12-May-04 9:06
professionalJeff Varszegi12-May-04 9:06 
GeneralRe: Debugging Pin
Jeff Varszegi12-May-04 9:33
professionalJeff Varszegi12-May-04 9:33 
GeneralRe: Debugging Pin
Anonymous12-May-04 12:56
Anonymous12-May-04 12:56 
GeneralSystem.Environment.MachineName exception Pin
Member 9993512-May-04 8:39
Member 9993512-May-04 8:39 
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;
}




Thx for your time,
Paul
GeneralRe: System.Environment.MachineName exception Pin
Jeff Varszegi12-May-04 9:03
professionalJeff Varszegi12-May-04 9:03 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 9:05
Member 9993512-May-04 9:05 
GeneralRe: System.Environment.MachineName exception Pin
Jeff Varszegi12-May-04 9:08
professionalJeff Varszegi12-May-04 9:08 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 9:22
Member 9993512-May-04 9:22 
GeneralRe: System.Environment.MachineName exception Pin
Jeff Varszegi12-May-04 9:32
professionalJeff Varszegi12-May-04 9:32 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 9:45
Member 9993512-May-04 9:45 
GeneralRe: System.Environment.MachineName exception Pin
Heath Stewart12-May-04 9:33
protectorHeath Stewart12-May-04 9:33 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 9:40
Member 9993512-May-04 9:40 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 9:43
Member 9993512-May-04 9:43 
GeneralRe: System.Environment.MachineName exception Pin
Heath Stewart12-May-04 9:45
protectorHeath Stewart12-May-04 9:45 
GeneralRe: System.Environment.MachineName exception Pin
Member 9993512-May-04 10:04
Member 9993512-May-04 10:04 
GeneralTextBox and odd chars Pin
Christer Claesson12-May-04 7:13
Christer Claesson12-May-04 7:13 
GeneralRe: TextBox and odd chars Pin
Heath Stewart12-May-04 9:43
protectorHeath Stewart12-May-04 9:43 
GeneralRe: TextBox and odd chars Pin
Christer Claesson12-May-04 10:37
Christer Claesson12-May-04 10:37 
GeneralRe: TextBox and odd chars Pin
Heath Stewart12-May-04 11:32
protectorHeath Stewart12-May-04 11:32 
General'Comparing' two strings. Pin
heelios12-May-04 7:09
heelios12-May-04 7:09 
GeneralRe: 'Comparing' two strings. Pin
Jeff Varszegi12-May-04 7:17
professionalJeff Varszegi12-May-04 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.