|
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; }
|
|
|
|
|
Also if you search the user contributed stuff on the NSIS website they HAD a function for determining if .NET was installed and would download it from the MS website and install it for you.
Steve Maier, MCSD MCAD
|
|
|
|
|
OK, i now finally have one that satisfies me. It can be found under http://nsis.sourceforge.net/archive/nsisweb.php?page=537&instances=0,110 and checks whether a minimum version of .net is installed.
the one you mentioned downloading .net is a bit too quick and dirty; it just checks
IfFileExists "$WINDIR\Microsoft.NET\Framework\v1.1.4322\installUtil.exe"
thanks
thomas
|
|
|
|
|
Hello,
I have a problem when building my project. Everything build fine, but I just have to build way too much. I'm sure that there is an 'easy' solution, but I don't know where to look.
I have a project that consist out of maybe 50 seperate dll's (probably around 40 are self developed and the others are bought from other vendors). The dll's are all strong named and offcourse there are dependencies between them.
Suppose I have following structure
Model.dll (-> classes used in every program I use (like customer, adress, ...)
Data.dll (depends on Model.dll -> classes to connect to mssql, access)
Diary.dll (depends on Model.dll and Data.dll -> program that represents a diary)
Statistics.dll (depends on Model.dll and Data.dll -> program that represents a statistical program)
Suppose that in the data.dll I have a method like the following (It's just an example)
public int GetSomeData (int _Test)
{
if (Test == 0)
return 1;
return -1;
}
Now I want to make the function like this
public int GetSomeData (int _Test)
{
if (Test == 0)
return 1;
else if (Test == 1)
return 0;
return -1;
}
I need to rebuild the data.dll offcourse. But because of the strongnaming I also have to recompile the Diary.dll and the Statistics.dll
This is somehow cumbersome and nothing changed in the code for these dll's.
My question now is: How can I rebuild the data.dll and not recompile it's depending dll's without breaking the dependency and knowing that all dll's are strong named? Or where should I be looking to solve this problem?
Thanks in advance,
Best regards,
Ike Casteleyn
icasteleyn@hotmail.com
|
|
|
|
|
Probably an easy answer to this one, but I can't see it.
I have a simple shared Assembly (Strong Named) packaged into a .msi for deployment on client machines.
I create the package using Microsofts Knowlwdgebase Q324168
"HOW TO: Deploy an Assembly to the Target Computer Global Assembly Cache"
It says
1. To the Solution that contains the project, add a new Setup Project that references to the assembly.
2. Right-click File System on Target Machine, click Add Special Folder, and then click Global Assembly Cache Folder.
3. By default, the assembly is inserted in the Application Folder (by default, it is a side-by-side installation). Drag the assembly to the Global Assembly Cache Folder.
4. Build the Setup Project.
I run the Setup on the target machine and all works fine.
The thing is I can't find the installed dll file anywhere on the client.
I have two applications sharing this dll and no clue of where it sits on the hard drive.
Does installing to the GAC cause an assembly to be treated differently?
Any ideas, would really appreciate any insight into this.
John
|
|
|
|
|
JohnARyan wrote:
Does installing to the GAC cause an assembly to be treated differently?
Yes.
The actual assemblies in the GAC are stored in %WINDOWS%\assembly, but the search feature in Windows Explorer won't be able to find them there. To view the contents, you can either use the shell extension provided (the folder will be viewed using the extension if you browse there with Windows Explorer) or the command-line tool Gacutil.exe.
gacutil.exe /l will list all the assemblies in the GAC while gacutil /l myassemblyname will give you the information for any matches it finds. (Note that you provide the assembly name, not the DLL name, so do not give the .dll extension)
I've found that an assembly won't be put into the application folder if it is placed in the GAC folder *and* it is excluded in the Detected Dependencies folder in the setup project. (Its icon will be shown in black and white and there will be a little circle with a cross through it.)
Charlie
if(!curlies){ return; }
|
|
|
|
|
Ok, time to ask the question here.. I have been battling over this one for sometime now and just have to ask it.
I have created a few classes that I use to act a security keys. These classes get serialized using a binary formatter and then symmetrically encrypted. The app will deserialize them and use the contents to judge licensing capabilities, etc…
Currently the license key and vectors are stored in the code. I don’t like the idea simply because it allows someone with a decompile to get at them. Yes, I can obfuscate the code but being paranoid like I am I have a feeling that is just not enough.
My real biggest fear besides the fact that someone can use the key to decrypt the data is that someone can also use the same key to create a program that will generate fake license keys for my app.
In another case I have to send a class across a wire on a remoting channel and the class is going to have a users name and password in it. Again, being the paranoid programmer that I am I am really afraid of someone with a sniffer out there looking at the raw bits. I would like to encrypt the password before I send the class across the wire. Again, I know that I can just hard code the keys into the app but we all know what I feel about that.
I know that I could use asymmetrical encryption and that gives me the ability to release a public key that can only be used to decrypt and that takes care of part of it but from what I have seen asymmetrical encryption is a royal pain in the butt because it only encrypts data of a maximum size so I would have to take that into account when I am serializing data and possibly split the data up into checks, each one encrypted…. Not a clean option really…
I know already, I have read tones of thing on remoting and how to build encryption sinks to be used for cases like this, but I really don't need to encrypt the entire message, just one part of it.
There HAS to be a way to reliably use symmetrical encryption without hard coding the keys into the code but also protecting them from being used by other people.
Any simple ideas to this tough question?
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.
|
|
|
|
|
Do you really think its worth the effort? As you have mentioned .Net assemblies can be easily decompiled. So even if your encryption is 100% safe a skilled programmer can still disable the whole licensing check.
|
|
|
|
|
Use hashing with salts. It basically works like this. You hash each user's password and store the hash on the server. The client also hashes the password entered and sends the hash to the server. The server verifies that the hashes match. To avoid dictionary attacks, you can use salting, where each user is assigned a random string which is appended to his password and the whole thing is hashed.
For a better technique and explanation, have a look at this link http://blogs.msdn.com/ericlippert/archive/2005/02/07/368569.aspx[^]
|
|
|
|
|
Recently, code was added to a Visual Studio .NET solution that includes .net dependencies. Previously, the solution had all MFC code. Now InstMsiW.Exe and InstMsiA.Exe don't appear in the output folder when the setup project is built. Is this something to be concerned about?
Thank you,
|
|
|
|
|
NET dependencies imply NET framework must be installed. The NET framework install automatically checks for the Windows Installer (and upgrades depending on the version found).
So the assumption is that when your project is dependent on NET you no longer need the InstMSI's, because of one of two reasons:
1) The NET framework is already installed so the Windows Installer service was installed/updated and does not need to be bootstrapped.
2) The NET framework will have to be installed, in which case the NET framework will take care of bootstrapping Windows Installer.
So including InstMSI in any setup that installs NET assemblies is pointless.
But there is a problem: Now instead of needing to bootstrap the Windows Installer (i.e. include InstMSI) you need to bootstrap the NET framework, because it might not exist on the target machine.
But unfortunately you cannot just add the NET framework install to your setup like you did with InstMSI.
See the MSDN for what is now required to deploy apps with NET dependencies:
http://support.microsoft.com/default.aspx?scid=kb;en-us;324733[^]
Robert
|
|
|
|