Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nathan Blomquist

@Nathan Blomquist
About
Posts
128
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Making a tray icon
    N Nathan Blomquist

    Otis_69 wrote: Thankyou for uhh... notify'ing me of that Hope it helps... -Nathan --------------------------- Hmmm... what's a signature?

    C# question

  • Making a tray icon
    N Nathan Blomquist

    Check out the [NotifyIcon](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsnotifyiconclasstopic.asp)[[^](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsnotifyiconclasstopic.asp "New Window")] class. -Nathan --------------------------- Hmmm... what's a signature?

    C# question

  • How to decide if a Point is on a curve
    N Nathan Blomquist

    Hmmm.... I don't know how to fix that problem right off had. You will have to look through the documentation some more. I am sorry that this did not solve the problem exactly. Please post here again if you find a solution. Sorry, Nathan --------------------------- Hmmm... what's a signature?

    C# tutorial question

  • How to decide if a Point is on a curve
    N Nathan Blomquist

    Hello, The way I have seen this done was in a project I worked on in a group for school. Check out the Region and GraphicsPath classes. Region is found in System.Drawing and GraphicsPath is in System.Drawing.Drawing2D. 1. DrawCurve to screen 2. Create a GraphicsPath and draw to it. 3. Create a Region from the GraphicsPath. 4. Invoke IsVisible( somePoint ) on the Region. In this case somePoint would be your mouse point. Hope this helps, Nathan --------------------------- Hmmm... what's a signature?

    C# tutorial question

  • System.Security.SecurityException
    N Nathan Blomquist

    Hello, Does your test app access the file system or anything else like that? Running an app from a network share is a security risk. So .NET sandboxes the app and doesn't let it do certain things. If you try copying the application to the harddrive, does it still cause the security exception? To fix the problem of sandboxing you will need to grant the application permissions to run from the network. Hope this helps, Nathan --------------------------- Hmmm... what's a signature?

    Visual Basic sysadmin security help

  • Is there a way to programatically determine if a binary is managed code?
    N Nathan Blomquist

    I know this function works with managed and unmanaged dlls. You could try it with executables though:public bool IsManaged(string filePath) { byte[] Data = new byte[4096]; FileInfo file = new FileInfo(filePath); FileStream fin = file.OpenRead(); int read = fin.Read(Data,0,Data.Length); fin.Close(); // Verify this is a executable/dll if ((Data[1] << 8 | Data[0]) != 0x5a4d) return false; // This will get the address for the WinNT header Int32 iWinNTHdr = Data[63]<<24 | Data[62]<<16 | Data[61] << 8 | Data[60]; // Verify this is an NT address if ((Data[iWinNTHdr+3] << 24 | Data[iWinNTHdr+2] << 16 | Data[iWinNTHdr+1] << 8 | Data[iWinNTHdr]) != 0x00004550) return false; Int32 iLightningAddr = iWinNTHdr + 24 + 208; Int32 iSum=0; Int32 iTop = iLightningAddr + 8; for (int i = iLightningAddr; i < iTop; i++) iSum|=Data[i]; if (iSum == 0) return false; else return true; }
    Got this from a blog entry here: http://blogs.msdn.com/adam_nathan/archive/2003/10/26/56786.aspx[^] Hope this helps, Nathan --------------------------- Hmmm... what's a signature?

    C# sysadmin question

  • FileIOPermission also takes away UIPermission?
    N Nathan Blomquist

    Thanks for all your help. I will just have to deal with them having the ability to Assert to get around it. I think it will stop most people from doing anything stupid... but it won't stop true hackers. Thanks again, Nathan --------------------------- Hmmm... what's a signature?

    C# security question announcement

  • FileIOPermission also takes away UIPermission?
    N Nathan Blomquist

    Heath Stewart wrote: If you want anyone to be able to extend your application, then you're on the right track. Create an instance of the permission(s) and call Deny on the instance. I would like others to develop plugins so that is why I wanted to deny things around the method calls into that plugin. I don't want plugins to be able to do anything evil and such to the user's computer or via the user's computer. The plugin should get all information from the program and that is it. I have found this to work around the method declaration of the abstract plugin methods. abstract class plugin { // override this to add functionality protected abstract void OnDoSomething(); [FileIOPermission(SecurityAccess.Deny,Unrestricted=true)] public void DoSomething() { OnDoSomething(); } } This will stop file accessing. But I found that the plugin derived from this can just do an FileIOPermission.Assert to get around this. Maybe I am thinking too much and there is no truly safe way to do these plugins. Maybe at some point I have to trust my users... Thanks again, Nathan --------------------------- Hmmm... what's a signature?

    C# security question announcement

  • FileIOPermission also takes away UIPermission?
    N Nathan Blomquist

    Is there and easy way to deny access to all files, but still allow UI to be presented to the user? Basically I am helping to develop a plugin architecture and we need to disable file access and possibly even socket access. So I was looking for something along the lines of: // psuedo code filePerm.DenyAllAccess(); sockPerm.DenyAllAccess(); myPlugin.DoSomethingClever(); sockPerm.RevertDeny(); filePerm.RevertDeny(); `Thanks, Nathan --------------------------- Hmmm... what's a signature?`

    C# security question announcement

  • FileIOPermission also takes away UIPermission?
    N Nathan Blomquist

    I was trying to limit some permissions on what certain methods can and cannot access. I wanted to disallow certain methods from accessing files. I found the FileIOPermissionAttribute, this seemed exactly what I wanted. But alas, if I use this attribute I cannot call showdialog on a form object.[FileIOPermission(SecurityAction.PermitOnly)] private void button1_Click(object sender, System.EventArgs e) { Form2 fm = new Form2(); fm.ShowDialog(); }
    The exception text: An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Additional information: Request for the permission of type System.Security.Permissions.UIPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. Can anyone explain why a UIPermission exception is thrown? -Nathan --------------------------- Hmmm... what's a signature?

    C# security question announcement

  • Messageboxes in managed C++
    N Nathan Blomquist

    leppie, I think his problem is not with strings. Instead it is that the preprocessor sees that MessageBox is defined as either MessageBoxA or MessageBoxU depending on build enviroment. The solution should be something like:... // this undefines the MessageBox macro #undef MessageBox // This should now work MessageBox::Show(S"Some text",S"Some text 2"); ...
    Or maybe I am just on crack or something... Feel free to flame me... -Nathan --------------------------- Hmmm... what's a signature?

    Managed C++/CLI c++ visual-studio tutorial question

  • More limited than internal?
    N Nathan Blomquist

    Sorry about the harsh post... I was in a bad mood yesterday. Also, my first post was a little more (shall I say) abstract than I wanted it to be. -Nathan --------------------------- Hmmm... what's a signature?

    C# help question

  • More limited than internal?
    N Nathan Blomquist

    Did you completely ignore my post before? Why not make TransactionManager a private class inside Control? Then you can just make Control public and expose only the methods you want to expose. I don't mean to sound harsh.... maybe I am just ignorant of you situation.... --------------------------- Hmmm... what's a signature?

    C# help question

  • String question
    N Nathan Blomquist

    sheesh, you beat my by two minutes.... hehe... that's what I get for reading down the page first :) --------------------------- Hmmm... what's a signature?

    C# question

  • String question
    N Nathan Blomquist

    Mike Ellison wrote: What is the technical difference between defining a string this way: string s = "this is my string"; and this way? string s = @"this is my string"; Well the first would try to escape certain characters followed by a slash string s = "this is a line \n with a newline embedded"; string s = @"this is a line \n with a slash n embedded"; The @ sign tells the compiler "this is a literal string, don't escape the characters after the slash". Hope this helps, Nathan --------------------------- Hmmm... what's a signature?

    C# question

  • More limited than internal?
    N Nathan Blomquist

    You could write a proxy class that sits in between your other classes and your "internal" class. This class would use your "internal" class and only expose those methods you want. -Nathan --------------------------- Hmmm... what's a signature?

    C# help question

  • Problem whit loops :x
    N Nathan Blomquist

    What the compiler is saying, is that "not all code paths return a value". This is because you don't return anything outside the foreach loop. The problem lies in the fact that it is theoritically possible that the queryCollection is empty. If it is empty you bypass the loop and go directly to the end of the method. Return something after the loop and the problem will go away. Also, are you sure you only want to execute the loop once? I mean right when you enter the foreach for the first time you will be exiting the method also. -Nathan --------------------------- Hmmm... what's a signature?

    C# database help

  • STL string
    N Nathan Blomquist

    you could try: string numText; char data[20]; int a = 100; sprintf(data,"Num is %d",a); numText = string(data); // this copies the char array into the string -Nathan --------------------------- Hmmm... what's a signature?

    C / C++ / MFC c++

  • string manipulation for phone numbers
    N Nathan Blomquist

    Check out the String.Insert() method.... --------------------------- Hmmm... what's a signature?

    C# question

  • C# Windows application and data store
    N Nathan Blomquist

    yeah, that is a down side... :( But with the app I am working on, it is a small thing compared to the rest (DirectX 9, MSDE, Framework 1.1)... so hell why not :) --------------------------- Hmmm... what's a signature?

    C# database csharp mysql sql-server sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups