Click here to Skip to main content
15,891,409 members
Home / Discussions / C#
   

C#

 
AnswerRe: some logical error in this.. help needeeeeeeeedddddddddddddddddddd Pin
led mike8-May-06 19:39
led mike8-May-06 19:39 
AnswerRe: some logical error in this.. help needeeeeeeeedddddddddddddddddddd Pin
J4amieC8-May-06 21:54
J4amieC8-May-06 21:54 
QuestionFailed to access IIS metabase Pin
V.thakur8-May-06 18:24
V.thakur8-May-06 18:24 
AnswerRe: Failed to access IIS metabase Pin
khanfresh11-May-06 23:11
khanfresh11-May-06 23:11 
QuestionHow to add a context menu to notifyicon for window service? Pin
sinanju8-May-06 16:15
sinanju8-May-06 16:15 
QuestionGive me advises about DoS recognition from Sniffer program! Pin
khanfresh8-May-06 16:05
khanfresh8-May-06 16:05 
AnswerRe: Give me advises about DoS recognition from Sniffer program! Pin
leppie8-May-06 20:43
leppie8-May-06 20:43 
QuestionPreventing unauthorized code execution Pin
Office Lineman8-May-06 14:41
Office Lineman8-May-06 14:41 
Is there a way to actually stop unauthorized use of code in a DLL?

The article on SecUtil[^] sounds nice, but doesn't work at all, unless I'm missing something painfully obvious.

I've got a signed DLL with a single public class exposing a single public method:

public class Thingy
{
  private const string PUBLIC_KEY = "0x00..." // a 160-byte hex string
  
  [StrongNameIdentityPermission(SecurityAction.Demand, PublicKey = PUBLIC_KEY)]
  public Thingy ()
  {
  }
  
  [StrongNameIdentityPermission(SecurityAction.Demand, PublicKey = PUBLIC_KEY)]
  public int Add (int v1, int v2)
  {
    return (v1 + v2);
  }
}

And I'm calling it in a separate unsigned application:

private void button1_Click (object sender, EventArgs e)
{
  Thingy thingy = new Thingy();
  
  int result = thingy.Add(6, 7);
  
  MessageBox.Show("6 + 7 = " + result.ToString());
}

It should be protected, and yet I get my message box "6 + 7 = 13" just fine.

Any ideas?

--
I've killed again, haven't I?
QuestionRe: Preventing unauthorized code execution Pin
Office Lineman9-May-06 7:30
Office Lineman9-May-06 7:30 
QuestionComparing two HTMLDocuments Pin
makuda8-May-06 13:59
makuda8-May-06 13:59 
AnswerRe: Comparing two HTMLDocuments Pin
led mike8-May-06 16:36
led mike8-May-06 16:36 
GeneralRe: Comparing two HTMLDocuments Pin
makuda8-May-06 20:08
makuda8-May-06 20:08 
GeneralRe: Comparing two HTMLDocuments Pin
makuda8-May-06 20:11
makuda8-May-06 20:11 
GeneralRe: Comparing two HTMLDocuments Pin
makuda8-May-06 20:14
makuda8-May-06 20:14 
GeneralRe: Comparing two HTMLDocuments Pin
CWIZO8-May-06 21:32
CWIZO8-May-06 21:32 
GeneralRe: Comparing two HTMLDocuments Pin
makuda8-May-06 23:44
makuda8-May-06 23:44 
GeneralRe: Comparing two HTMLDocuments Pin
makuda8-May-06 23:45
makuda8-May-06 23:45 
Questiontooltip Pin
Manu_818-May-06 13:28
Manu_818-May-06 13:28 
AnswerRe: tooltip Pin
sathish s8-May-06 21:54
sathish s8-May-06 21:54 
Questioncontro with custom properties Pin
Susuko8-May-06 13:25
Susuko8-May-06 13:25 
AnswerRe: contro with custom properties Pin
DigitalKing8-May-06 17:18
DigitalKing8-May-06 17:18 
GeneralRe: contro with custom properties Pin
Sasuko9-May-06 5:07
Sasuko9-May-06 5:07 
QuestionC#, CompactFramework and RAS Pin
martin_hughes8-May-06 10:31
martin_hughes8-May-06 10:31 
QuestionDetermine max column length info using SqlDataAdapter, XmlDataDocument classes in C# Pin
PrashantJ8-May-06 10:18
PrashantJ8-May-06 10:18 
QuestionIs this a bad way to multithread? Pin
Joshua Lunsford8-May-06 10:13
Joshua Lunsford8-May-06 10:13 

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.