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

C#

 
AnswerRe: virtual USB device Pin
Bernhard Hiller22-Aug-11 22:29
Bernhard Hiller22-Aug-11 22:29 
GeneralRe: virtual USB device Pin
Grimes22-Aug-11 22:39
Grimes22-Aug-11 22:39 
AnswerRe: virtual USB device Pin
John Clegg23-Aug-11 2:29
professionalJohn Clegg23-Aug-11 2:29 
GeneralRe: virtual USB device Pin
Grimes23-Aug-11 2:53
Grimes23-Aug-11 2:53 
QuestionDatagridview to Excel.....using error (again) Pin
PDTUM22-Aug-11 9:43
PDTUM22-Aug-11 9:43 
AnswerRe: Datagridview to Excel.....using error (again) Pin
SledgeHammer0122-Aug-11 10:38
SledgeHammer0122-Aug-11 10:38 
GeneralRe: Datagridview to Excel.....using error (again) Pin
PDTUM22-Aug-11 16:38
PDTUM22-Aug-11 16:38 
QuestionLevel of privileges Pin
Herboren22-Aug-11 6:36
Herboren22-Aug-11 6:36 
How do I know which files on the system have different level of privileges. For example, if the 'at.exe' runs from the command prompt to open cmd.exe then the new cmd.exe has been given system privilages

Is there any way to dump the level of privileges to a text file. I managed to get the application descriptions to a listview, now just trying to get their security levels.

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;

namespace FileDescription
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            GetFileDescription();
        }
        private void GetFileDescription()
        {
            string[] fileInfo = Directory.GetFiles(Environment.SystemDirectory);            

            foreach (string str in fileInfo)
            {
                if (str.ToString().Contains(".exe"))
                {
                    ListViewItem lvi = new ListViewItem();
                    FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(str);
                    
                    lvi = lv.Items.Add(str);
                    lvi.SubItems.Add(myFileVersionInfo.FileDescription);
                }
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            lv.Columns.Add("File",200,HorizontalAlignment.Left);
            lv.Columns.Add("Description",400,HorizontalAlignment.Left);
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Process.Start(lv.SelectedItems[0].ToString());
        }

        
    }
}


Thats what I turned out with.
AnswerRe: Level of privileges Pin
Richard Andrew x6422-Aug-11 11:27
professionalRichard Andrew x6422-Aug-11 11:27 
QuestionHow do I generate a number divisable by 5, and check it? PinPopular
stephen.darling22-Aug-11 3:42
stephen.darling22-Aug-11 3:42 
AnswerRe: How do I generate a number divisable by 5, and check it? PinPopular
Luc Pattyn22-Aug-11 3:46
sitebuilderLuc Pattyn22-Aug-11 3:46 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
stephen.darling22-Aug-11 4:01
stephen.darling22-Aug-11 4:01 
AnswerRe: How do I generate a number divisable by 5, and check it? PinPopular
Manfred Rudolf Bihy22-Aug-11 4:47
professionalManfred Rudolf Bihy22-Aug-11 4:47 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
GParkings1-Sep-11 7:39
GParkings1-Sep-11 7:39 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
Manfred Rudolf Bihy22-Aug-11 4:52
professionalManfred Rudolf Bihy22-Aug-11 4:52 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
Fabio Franco23-Aug-11 3:04
professionalFabio Franco23-Aug-11 3:04 
AnswerRe: How do I generate a number divisable by 5, and check it? Pin
Luc Pattyn23-Aug-11 3:31
sitebuilderLuc Pattyn23-Aug-11 3:31 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
Fabio Franco23-Aug-11 4:00
professionalFabio Franco23-Aug-11 4:00 
AnswerRe: How do I generate a number divisable by 5, and check it? Pin
riced22-Aug-11 3:54
riced22-Aug-11 3:54 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
stephen.darling22-Aug-11 4:00
stephen.darling22-Aug-11 4:00 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
David198722-Aug-11 4:02
David198722-Aug-11 4:02 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
Luc Pattyn22-Aug-11 4:29
sitebuilderLuc Pattyn22-Aug-11 4:29 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
David198722-Aug-11 5:05
David198722-Aug-11 5:05 
AnswerRe: How do I generate a number divisable by 5, and check it? PinPopular
Luc Pattyn22-Aug-11 5:30
sitebuilderLuc Pattyn22-Aug-11 5:30 
GeneralRe: How do I generate a number divisable by 5, and check it? Pin
OriginalGriff22-Aug-11 6:05
mveOriginalGriff22-Aug-11 6:05 

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.