|
Maybe I am showing some low-level ignorance of data types here but I just don't understand why we have these
VB.NET
Short
Integer
Long
C#
short
int
long
When we have these:
System.Int16
System.Int32
System.Int64
Can anyone explain this to me?
If it is just for backwards compatibility with code on the part of VB I don't really buy it because the same things are there in C# and there should not have been any backwards issues with 'old C# code' to worry about.
Anyone want to enlighten me?
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
I believe that the System ones are objects, and the other ones are basic types, which means among other things that you can't do if myObject is short
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I don't think that's correct, the C# keywords are just aliases for the System classes. So int is exactly the same as System.Int32, which derives from System.Object. It is the same in VB.NET too.
As to why they added aliases, maybe it is to preserve the feel of the language.
Regards
Senthil
|
|
|
|
|
Hi,
I've got a C# .NET forms application - I need to make this program support a number of differant languages. I've done the basics of getting it ready to be localized. i.e. I have all my strings stored in a simple text file with keys and they get compiled into satellite DLL's so I can add new languages and the app will use them.
However I have a question regarding the best way to manage this process. At the moment I have a strings.txt file, which contains strings that are used in the program such as error messages.
Then the UI, each Window in the program and the dialogs etc, they all have their own language-strings and prompts actually just add'ed to them in the VS.NET designer.
I know that each Windows Form has a .resx file which contains all the resources, including these strings.
I guess my question is, how can I simplfy the process of adding new languages - I pretty much don't want to have to sit there, make each form "Localizable" and then type each different language version in to the VS.NET IDE.
Especially as I'm not the one doing the translating.
Is there anyway to get the UI to use strings from a non-default resource file as such? Maybe so I could get all the strings in one place and then send them away to be translated.
Is there is a simple way to do this that I'm missing?
Thanks
Simon
|
|
|
|
|
I want to get physical address of NIC in .Net Framework. Please help me!
|
|
|
|
|
Try the ARP command which displays the physical address. You can use the System.Diagnostics.Process class to run the ARP command from .NET.
|
|
|
|
|
Hi,
My NET debuggers do not work. I get an error:
"Error while trying to run project:Unable to start debugging.
No such interface supported."
Note that this is not the commonly mentioned web debugger problem.
I have tried completely uninstalling VS NET and re-installing. Did not fix.
Any suggestions?
Thanks,
Robert
|
|
|
|
|
I finally tried uninstalling IE6 and re-installing IE6. Now my debuggers work, but the startup page throws script errors.
Arrgggghh!!
Robert
|
|
|
|
|
OK, I'm ready to be ridiculed.
I've run into an issue when attempting to use strong names. I've followed darwen's example and have it working in a console app, but it fails in a windows app with
An unhandled exception of type 'System.Security.SecurityException' occurred in StrongNameTestForm.exe
Additional information: Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
(additional details at the bottom of this message) or (if not run in the ide)
The application attempted to perform an operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool.
If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will be shut down immediately.
Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlig, Version-1.0.50000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
If I change the application from a windows app to a console app the call works in main() [before Application.Run(new Form1());], but not in the button click event from the form.
I've run the .NET Configuration tool (mscorcfg.msc) and tried adding an application and adding a code group (enterprise, machine, and user; new code group with a condition of Strong Name with the public key [the dll, the console app, and the windows app all show the same public key] without specifying the name or version and with the permission set of full trust) all to no avail. I have also tried this on multiple machines.
I do have a small (59k) zip file of my solution and projects, if anyone is interested.
Additional details:
************** Exception Text **************
System.Security.SecurityException: Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean ignoreGrants, TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet denied, PermissionSet demands)
at StrongNameAssembly.StrongNameTestAssembly.StaticEcho(String text) in C:\dl\dotNET\code samples\Securing\StrongNameTest\StrongNameAssembly\StrongNameTestAssembly.cs:line 31
at StrongNameTestForm.Form1.btnStaticTest_Click(Object sender, EventArgs e) in c:\dl\dotnet\code samples\securing\strongnametest\strongnametestform\form1.cs:line 108
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The state of the failed permission was:
<ipermission class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
="" version="1" publickeyblob="002400000480000094000000060200000024000052534131000400000100 01009515D3907C35834756D430D20B8C4672668C3CAC0EFF041317166F8CC53FDA01CE72D7C 728A942762957F6A7A2264656EBCE5C04078AAFD3E6F7FFFB6ADC799AB011CED46D9B6129F1 1E6517144138B57C85865CBC56E4F2BFFF6651F3FF702F0E039F16CEE9F31B976B51A582977 478B3DD0A52CAC873814646F01FABC8E2BE">
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
StrongNameTestForm
Assembly Version: 1.0.1865.20729
Win32 Version: 1.0.1865.20729
CodeBase: file:///C:/dl/dotNET/code%20samples/Securing/StrongNameTest/StrongNameTestForm/bin/Debug/StrongNameTestForm.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
StrongNameAssembly
Assembly Version: 1.0.1865.19430
Win32 Version: 1.0.1865.19430
CodeBase: file:///C:/dl/dotNET/code%20samples/Securing/StrongNameTest/StrongNameTestForm/bin/Debug/StrongNameAssembly.DLL
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
|
|
|
|
|
I've found the problem (thanks to others).
I was using SecurityAction.Demand rather than SecurityAction.LinkDemand.
Demand checks all assemblies in the stack for permission. Obviously there was some issue with permissions on one of the .NET assemblies, but I'm not going to worry about it.
|
|
|
|
|
Hi!
Is there a way I can tell when a class library is loaded.
I want a static item in in a class library when it's loaded and then if it's unloaded I want to remove this item.
Is this possible?
|
|
|
|
|
Why don't you simply put it in a type constructor (or declare it as static)? That way, it will run before any field in that type is accessed. What's the point in removing the item if the assembly itself is going to be unloaded?
Regards
Senthil
|
|
|
|
|
Hi,
I need some with the Socket programming in C#. I’m a old Borland C++ Builder and converted to .NET some years ago. But I still miss a lot of nice features :-> Can anybody here help me with getting a “event”, interrupt or callback when one end of a socket connection disconnects. I’m not thinking about when a user or application disconnects deliberately but more like when someone pulls the cable or switches off the pc.
Can some one help me?
/ Magnus
|
|
|
|
|
well, I'm trying to write a .NET 2.0 application (since I need serial-ports and I hate using non-.NET-components) but I have a problem...
every time I run my programm (serial-ports don't do anything yet so that shouldn't be the problem) I get a NullReferenceException...
when I try to run it with the debugger, first it's about 500times slower and second the exception isn't thrown at all but the debugger locks up somewhat later...
I'm using threads so maybe that could be the cause but the main problem I got is:
when the exception is thrown (without debugger) it gives me the option to launch the jit-debugger... but when I click to launch it it launches visual studio 2003; and that just can't debug .NET 2.0
so:
how do I get the jit-debugger to use vs2005?
any idea?
thanks, so long.
|
|
|
|
|
Hi...
I can't seem to get the column name stored in a string.
It keeps giving me this error:
Embedded statement cannot be a declaration or labeled statement
This is what I am trying to do..
for(int col=0; col
|
|
|
|
|
Your for loop isnt complete:
for (int col = 0; col < personTbl.Columns.Count; i++) {
string colName = personTbl.Columns[col].ColumnName;
}
|
|
|
|
|
sorry....
cut and paste error...I have it just like yours
|
|
|
|
|
I'm writing an essay on .NET framework, but I can't find any information on how Microsoft started the .NET development, the timescale and so on.
There seems to be a lot of information out there how Java was made but nothing about .NET. Hasn't Microsoft released that information to the press ?
Regards, Desmond
|
|
|
|
|
|
Thanks, that was usefull, anything else ?
|
|
|
|
|
Hi..
I am new to datagrid and windows forms. Here's is what I am trying to do. I have a datagrid which is bound to a datasource. In my datagrid I have a custom combobox column. Depending upon users selection in the combobox column certain columns in the datagrid becomes uneditable.
I have no idea how to capture user input from the combobox column and inactivate the dependable columns.
I have no idea where to start...
Any help will be greatly appreciated
Thanks in advance
-RP
|
|
|
|
|
i am not sure my giving this solution that, is it true or no ? but please try to solve your prblem.
firt, capture the value from the combo box and than check its with other columns which you want to made uneditable by apply the contion that if the particulare item is selected from the combobox than set the editable property of that columns.
|
|
|
|
|
Dear,
You can try in this way. You can use the method FindControl of the datagrid item to find the control in your datagrid
<br />
Dim x as new control<br />
for each x in datagrid.controls<br />
...<br />
next<br />
You use this code to show all the control in the datagrid, then you can try deeper into the datagrid item to find your combobox... then you can use the method findcontrol in the datagrid item to get value and set value for your control.
PS: I'm not sure if the code is correctly right or not. But that's the idea. I did well in ASP .NET
Ich liebe .NET
|
|
|
|
|
Does Microsoft specify a way to determine whether the .net framework is installed?
I'd like to use that in a NSIS-Skript.
thomas
|
|
|
|
|
From http://blogs.msdn.com/junfeng/archive/2004/02/05/67815.aspx[^]
For v1.0:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0]. If REG_SZ value 3705 exists, then .Net framework v1 is installed.
For v1.1:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.1] ...test the existence of REG_SZ value 4322.
Charlie
if(!curlies){ return; }
|
|
|
|