View RSS Feed

benrwb

  1. SIMSPERM!

    by , 23rd May 2011 at 09:35 AM
    I have adapted the SIMSPERM batch file so that it can be applied as a Startup Script via Group Policy.

    Code:
    @echo off
    
    if not exist "%ProgramFiles%\SIMS" goto end
    
    if exist "%ProgramFiles%\SIMS\doneperm.txt" goto end
    
    path \\server\netlogon
    
    SubInAcl /FILE %WINDIR%\SIMS.INI /GRANT=domain\group=F
    SubInAcl /SUBDIRECTORIES "%ProgramFiles%\SIMS\*.*" /GRANT=domain\group
    ...
    Tags: sims.net
    Categories
    Uncategorized
  2. Winforms WebBrowser control

    by , 11th April 2011 at 01:06 PM
    I've been playing around with the WinForms WebBrowser control this morning, and after lots of experimentation have finally figured out how to use some of the printing functionality.

    First of all, Add a Reference to SHDocVw. (Project > Add Reference > Browse > C:\Windows\System32\shdocvw.dll)

    Secondly load a document into the browser using webBrowser1.Navigate(url).

    Then,
    to do "Print Preview"...
    Code:
    IWebBrowser2 browser
    ...
    Tags: coding, visual c#
    Categories
    Uncategorized
  3. Getting a list of tables in an Access database (C#)

    by , 4th March 2011 at 12:13 PM
    Posting this code so that I can remember it/ and in case anyone else finds it useful.

    First open the database
    Code:
    string constr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source=database.mdb";
    OleDbConnection con = new OleDbConnection(constr);
    con.Open();
    con.GetSchema() will return a list of collections in the database.

    Code:
    CollectionName        NumberOfRestrictions NumberOfIdentifierParts
    --------------------- --------------------
    ...