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
O

Okultist

@Okultist
About
Posts
7
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Installing fonts on a Vista Pc
    O Okultist

    I think its not possible to copy the Font file to the font-folder with out adminstrator status. so i decided to use an application manifest to run my program as a adminstrator on startup.

    C# help

  • Installing fonts on a Vista Pc
    O Okultist

    Yeah, the problem is that i am using vista and a few things changed there. There are new security rules and i tried to do it the "good" way by asking the system for permissions.

    C# help

  • Installing fonts on a Vista Pc
    O Okultist

    Is there a fast way to have a look on the privileges an user has for a folder? the windows explorer should have a way look them up.

    C# help

  • Installing fonts on a Vista Pc
    O Okultist

    I want to copy a font file to the fonts directory on windows vista, but currently i fail to get the right permissions. Everytime I try to copy the font from its current folder to the font-directory (c:\windows\fonts) I get an "UnauthorisedAccessException" My code looks like this at the moment:

            if (System.IO.File.Exists(fontPath))
            {
                FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, "C:\\\\Windows\\\\Fonts\\\\");
                f2.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.Write, fontPath);
    
                if (SecurityManager.IsGranted(f2) == true)
                    MessageBox.Show("Its fine!!");
                else
                    MessageBox.Show("No Permissions");
    
                try
                {
                    f2.Demand();
                    MessageBox.Show(fontPath);
                    System.IO.File.Copy(fontPath, destination);
                    //AddFontResource(fontPath);
                    //SendMessage(HWND\_BROADCAST, WM\_FONTCHANGE, (IntPtr)0, (IntPtr)0);
    
                }
                catch (SecurityException se)
                {
                    MessageBox.Show(se.ToString());
                }
                catch (UnauthorizedAccessException ex)
                {
                    MessageBox.Show(ex.ToString());
                }
    
            }
    

    Thanks for your help

    C# help

  • install windows fonts
    O Okultist

    I think i have the same problem. I want to copy the a font file by using my program, but the only thing i managed until now is to register the font file vie AddFontResoucre so openoffice can use it until my pc reboots. I tried to get write permissions by using FileIoPermission for the font-Directory but when my program actually copies the file to the directory it says i dont have the permission to do so. My code looks like this:

    FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, "C:\\Windows\\Fonts\\");
    f2.AddPathList(FileIOPermissionAccess.Read, fontPath);
    try
    {
    f2.Demand();
    System.IO.File.Copy(fontPath, destination);
    }
    catch (SecurityException se)
    {
    MessageBox.Show(se.ToString());
    }
    catch (UnauthorizedAccessException ex)
    {
    MessageBox.Show(ex.ToString());
    }

    C# json question

  • FileIOPermission Problem
    O Okultist

    Can someone give me some help on this please, since i dont know what i am doing wrong? I used a messagebox to have a quick look at the permmission i requested and it says i asked for write permission for C:\Windows\Fonts and read permission for the folder in "origin". Is there something else I have to do?

    C# help debugging question

  • FileIOPermission Problem
    O Okultist

    Good Evening, currently I am doing a small program which copies a file from one folder to another folder. The destination folder is the "Fonts" folder which holds all fonts of my system. Currently my code looks like this:

    FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, "C:\\Windows\\Fonts\\");
    f2.AddPathList(FileIOPermissionAccess.Read , origin);

     try
     {
          System.IO.File.Copy(origin, destination);
     }
     catch (UnauthorizedAccessException ex)
     {
           MessageBox.Show(ex.ToString());
     }
    

    When I start debugging, the debugger tells me that I dont have permission for C:\Windows\Fonts\"filename". Which confuses me a bit since I thought I already got write permission to "C:\Windows\Fonts\". What am i doing wrong? P.S.: I am using Windows Vista SP1 64-Bit Thanks for your help and advices

    C# help debugging 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