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
M

mikker_123

@mikker_123
About
Posts
100
Topics
31
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • KVM Recommendations
    M mikker_123

    I used MaxiVista for a quite time and thought that it is great utility. After seeing Synergy at work I can just say -> wow... opensource really rocks :). So here is one more vote to -> forget KVM switch, use Synergy.

    The Lounge workspace sysadmin security help question

  • Application partitioning
    M mikker_123

    Can anyone point me to more resources on Application partitioning using SQL Server? I'm thinking about developing multi-company portal so I'm in research phase for finding something that'll work out best in that case. Thanks in advance!

    Database database sql-server sysadmin question

  • Hate new MSDN search
    M mikker_123

    A week ago I provided little help to my friend on some ASP.NET project. We were sitting in restaurant and working on his laptop after lunch while suddenly I needed more information on impersonation (how to specify user for impersonation). We didn't had any Internet connection so I almost gave up and said: "I'll google-search that first thing when I come home and send you - it's just one line in web.config". But then I remembered - he had Visual Studio .NET 2003 and MSDN library for that version... and in few moments I found what I needed using old MSDN search box. I was delighted that could use MSDN library v2003 again. * * * Point is - ____I HATE____ MSDN LIBRARY THAT COMES WITH VS.NET 2005. AND I HATE www.msdn.com. And I often wonder if I'm just plain stupid for not knowing to use it... or the guys working on it are real talents to screw things that worked fine. Any comment? Any suggestion? Any proposition on how to better search within MSDN Library? Or to just give up and use Google? P.S. I love rant (link) from this guy :)

    The Lounge csharp visual-studio asp-net com help

  • Casting generic parameters to int
    M mikker_123

    :( that's what I meant... tnx for correcting me Daniel.

    C# question database data-structures

  • Please Help: ClickOnce Technology
    M mikker_123

    You can't specify install directory on client if you use ClickOnce... If that is absolutely necessary, well -> then you'll have to use some other deployment technology. However, if you provide me with more info on what you're trying to achieve, I'm willing to give you more suggestions. Enjoy!

    C# csharp help visual-studio

  • Dynamic webcontrols in winforms
    M mikker_123

    Sounds like you are taking very complex project... I just know that it must be way easier to develop that what you want as Windows application than ASP.NET + AJAX (this is answer to 3). In any case, good starting point would be to see how existing editors work - I found this article && you can take a look at SharpDevelop which is open source IDE for .NET (source code on this link). If you have more questions - shoot :)

    C# csharp winforms visual-studio com design

  • how to print any control in vc#2005 ?
    M mikker_123

    Are you looking for something like this?

    C# tutorial csharp question

  • using list object as a public property in custom control
    M mikker_123

    Code you gave doesn't tell much, for example I don't see any relation with UserControl and Student class. It could be possible that you initialize student class in Control constructor (use Load event instead and use if (!DesignMode) { }), or that you have two Student classes... So please provide more code (like complete definition of both classes). P.

    C# help

  • Casting generic parameters to int
    M mikker_123

    Why don't you try with:

    public class SubjectIndexComparer : IComparer
    {
    ...
    public int Compare(int x, int y)
    {
    ...
    }
    }

    ? Does that helps?

    C# question database data-structures

  • Automatically adding dll file to publish without reference
    M mikker_123

    If I understand you correctly this should solve your problem: 1. Copy non-referenced dll to your project's directory and add it to project using Add -> Existing Item -> browse to dll. 2. When it is added to project, right click in it on Solution Explorer -> Properties and Set Build Action -> Content (ClickOnce problem) && Copty to Output Directory -> Copy Always (autocopy) in Properties Window 3. If you now right click on your project icon in Solution Explorer -> go to project Properties -> Publish -> Application Files, you should see your dll in list with status Include(Auto). Hope this solves your problem, if not -> give more details and I'll answer :). Cheers!

    C# csharp visual-studio help testing debugging

  • how to access protected-pass folder
    M mikker_123

    You are looking for something like this?

    C# question csharp winforms security xml

  • Give Access to Certificate in Store
    M mikker_123

    Dunno... Add method works great for me. Anyways I found some kind of solution googling, it works, but I don't like it. Anyways, if someone has better solution please post, until then I'll use this:

        private static void PlaceInStore(X509Certificate2 cert)
        {
            X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
    
            try
            {
                store.Open(OpenFlags.ReadWrite);
    
                if (!store.Certificates.Contains(cert))
                    store.Add(cert);
    
                int indexInStore = store.Certificates.IndexOf(cert);
                cert = store.Certificates\[indexInStore\];
    
                AddAccessToCertificate(cert, "ARCHITECT\\\\testuser");
            }
            finally
            {
                store.Close();
            }
        }
    
        private static void AddAccessToCertificate(X509Certificate2 cert, string user)
        {
            RSACryptoServiceProvider rsa = cert.PrivateKey as RSACryptoServiceProvider;
    
            if (rsa != null)
            {
                string keyfilepath =
                    FindKeyLocation(rsa.CspKeyContainerInfo.UniqueKeyContainerName);
    
                FileInfo file = new FileInfo(keyfilepath + "\\\\" +
                    rsa.CspKeyContainerInfo.UniqueKeyContainerName);
    
                FileSecurity fs = file.GetAccessControl();
    
                NTAccount account = new NTAccount(user);
                fs.AddAccessRule(new FileSystemAccessRule(account,
                FileSystemRights.FullControl, AccessControlType.Allow));
    
                file.SetAccessControl(fs);
            }
        }
    
        private static string FindKeyLocation(string keyFileName)
        {
            string text1 =
            Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
            string text2 = text1 + @"\\Microsoft\\Crypto\\RSA\\MachineKeys";
            string\[\] textArray1 = Directory.GetFiles(text2, keyFileName);
            if (textArray1.Length > 0)
            {
                return text2;
            }
            string text3 =
            Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string text4 = text3 + @"\\Microsoft\\Cry
    
    C# com cryptography help question

  • how to access protected-pass folder
    M mikker_123

    Cmon... assume some solution to my certificate problem ;)

    C# question csharp winforms security xml

  • how to access protected-pass folder
    M mikker_123

    LOL :)... I asked same thing but for certificates... and googling for you solution I think I found mine. Anyways... if you wish to control permissions use following code (example is for directory): private static void GiveAccessToFolder() { string path = @"d:\testFolder\"; DirectorySecurity ds = Directory.GetAccessControl(path); ds.AddAccessRule(new FileSystemAccessRule("ARCHITECT\\testuser", FileSystemRights.FullControl, AccessControlType.Allow)); Directory.SetAccessControl(path, ds); } You can find more examples over here. Enjoy friend!

    C# question csharp winforms security xml

  • Give Access to Certificate in Store
    M mikker_123

    I just want to add X509Certificate to store, and enable user to read it's private key. I snatched part of code from here but it won't work. private static void PlaceInStore(X509Certificate2 cert) { X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); try { store.Open(OpenFlags.ReadWrite); using (RSACryptoServiceProvider csp = cert.PrivateKey as RSACryptoServiceProvider) { CspKeyContainerInfo kci = csp.CspKeyContainerInfo; CryptoKeySecurity cks = kci.CryptoKeySecurity; cks.SetAccessRule(new CryptoKeyAccessRule("ARCHITECT\\testuser", CryptoKeyRights.FullControl, AccessControlType.Allow)); } if (!store.Certificates.Contains(cert)) store.Add(cert); } finally { store.Close(); } } Help anyone?

    C# com cryptography help question

  • Using results multiple times
    M mikker_123

    Tnx for your answers!

    Database database sql-server sysadmin question

  • Using results multiple times
    M mikker_123

    Would it be smarter to use Table variables in this case? I read that they interrupt parallel execution. Thanks for your previous answer in any case!

    Database database sql-server sysadmin question

  • Using results multiple times
    M mikker_123

    OK, probably it is an easy answer, but I just can't get it working. I'm working on SQL SERVER 2005. Here is stored procedure: SELECT TOP (50) * FROM h_Case WHERE ((FirstName LIKE @FirstName) AND (LastName LIKE @LastName) OR ((IsNull(Aliases, '') LIKE @FirstName) AND (IsNull(Aliases, '') LIKE @LastName))) AND (DOB BETWEEN @DobFrom AND @DobTo) AND (IsNull(GenderId, -1) BETWEEN @GenderFrom AND @GenderTo) AND (IsNull(PHN, '') LIKE @PHN) SELECT * FROM h_Encounter WHERE CaseId IN (SELECT TOP (50) CaseId FROM h_Case WHERE ((FirstName LIKE @FirstName) AND (LastName LIKE @LastName) OR ((IsNull(Aliases, '') LIKE @FirstName) AND (IsNull(Aliases, '') LIKE @LastName))) AND (DOB BETWEEN @DobFrom AND @DobTo) AND (IsNull(GenderId, -1) BETWEEN @GenderFrom AND @GenderTo) AND (IsNull(PHN, '') LIKE @PHN)) SELECT cn.*, u.Username AS Username FROM h_CaseNote cn INNER JOIN c_User u ON u.UserId = cn.UserId WHERE CaseId IN (SELECT TOP (50) CaseId FROM h_Case WHERE ((FirstName LIKE @FirstName) AND (LastName LIKE @LastName) OR ((IsNull(Aliases, '') LIKE @FirstName) AND (IsNull(Aliases, '') LIKE @LastName))) AND (DOB BETWEEN @DobFrom AND @DobTo) AND (IsNull(GenderId, -1) BETWEEN @GenderFrom AND @GenderTo) AND (IsNull(PHN, '') LIKE @PHN)) SELECT * FROM h_CasePDR WHERE CaseId IN (SELECT TOP (50) CaseId FROM h_Case WHERE ((FirstName LIKE @FirstName) AND (LastName LIKE @LastName) OR ((IsNull(Aliases, '') LIKE @FirstName) AND (IsNull(Aliases, '') LIKE @LastName))) AND (DOB BETWEEN @DobFrom AND @DobTo) AND (IsNull(GenderId, -1) BETWEEN @GenderFrom AND @GenderTo) AND (IsNull(PHN, '') LIKE @PHN)) RETURN So it is obvious what I'm trying to do? I just want to reuse selected cases. I tried with: WITH C AS ( SELECT TOP (50) CaseId FROM h_Case WHERE ((FirstName LIKE @FirstName) AND (LastName LIKE @LastName) OR ((IsNull(Aliases, '') LIKE @FirstName) AND (IsNull(Aliases, '') LIKE @LastName))) AND (DOB BETWEEN @DobFrom AND @DobTo) AND (IsNull(GenderId, -1) BETWEEN @GenderFrom AND @GenderTo) AND (IsNull(PHN, '') LIKE @PHN) SELECT * FROM C SELECT * FROM h_Encounter WHERE CaseId IN (SELECT CaseId FROM C) SELECT cn.*, u.Username AS Username FROM h_CaseNote cn INNER JOIN c_User u ON u.UserId = cn.UserId WHERE CaseId IN (SELECT CaseId FROM C) SELECT * FROM h_CasePDR WHERE CaseId IN (SELEC

    Database database sql-server sysadmin question

  • Help with XML design.
    M mikker_123

    At least I hope you won't die at 28 :)

    C# question design game-dev xml help

  • Changing what BindingSource references
    M mikker_123

    Doing this breaks databinding of controls bindingSourceOnWhichControlsAreBound = bindingSourceWithData; similary like dataSetOnWhichControlsAreBound = dataSetWithData; However when using DataSet you can do: dataSetOnWhichControlsAreBound.Clear; dataSetOnWhichControlsAreBound.Merge(dataSetWithData); Is there something similar for bindingSource? Tnx

    C# question
  • Login

  • Don't have an account? Register

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