Click here to Skip to main content
15,908,901 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Telerik radscheduler day view problem Pin
Eddy Vluggen18-Jun-17 3:14
professionalEddy Vluggen18-Jun-17 3:14 
GeneralRe: Telerik radscheduler day view problem Pin
Dave Kreskowiak18-Jun-17 3:45
mveDave Kreskowiak18-Jun-17 3:45 
QuestionRe: Telerik radscheduler day view problem Pin
Eddy Vluggen18-Jun-17 10:39
professionalEddy Vluggen18-Jun-17 10:39 
QuestionGet the logs from fingerprint device Pin
Meax6-Jun-17 22:39
Meax6-Jun-17 22:39 
SuggestionRe: Get the logs from fingerprint device Pin
Richard MacCutchan6-Jun-17 22:53
mveRichard MacCutchan6-Jun-17 22:53 
AnswerRe: Get the logs from fingerprint device Pin
Patrice T9-Jun-17 10:59
mvePatrice T9-Jun-17 10:59 
AnswerRe: Get the logs from fingerprint device Pin
jschell15-Jun-17 9:36
jschell15-Jun-17 9:36 
Questionmvc identity, sending email confirmation with extra parameter Pin
orsini4430-May-17 10:10
orsini4430-May-17 10:10 
AnswerRe: mvc identity, sending email confirmation with extra parameter Pin
Peter_in_278030-May-17 13:17
professionalPeter_in_278030-May-17 13:17 
QuestionHi guys can you help me to deal with this error pls! Its an "End os statemente expect" Pls help! Pin
nseiV2.025-May-17 5:16
nseiV2.025-May-17 5:16 
AnswerRe: Hi guys can you help me to deal with this error pls! Its an "End os statemente expect" Pls help! Pin
NotPolitcallyCorrect25-May-17 5:23
NotPolitcallyCorrect25-May-17 5:23 
QuestionCannot get data to display in textbox from the database vb.net Pin
Member 1257814223-May-17 9:30
Member 1257814223-May-17 9:30 
AnswerRe: Cannot get data to display in textbox from the database vb.net Pin
NotPolitcallyCorrect23-May-17 9:50
NotPolitcallyCorrect23-May-17 9:50 
GeneralRe: Cannot get data to display in textbox from the database vb.net Pin
Member 1257814224-May-17 8:22
Member 1257814224-May-17 8:22 
GeneralRe: Cannot get data to display in textbox from the database vb.net Pin
NotPolitcallyCorrect24-May-17 9:24
NotPolitcallyCorrect24-May-17 9:24 
GeneralRe: Cannot get data to display in textbox from the database vb.net Pin
Member 1257814224-May-17 11:43
Member 1257814224-May-17 11:43 
GeneralRe: Cannot get data to display in textbox from the database vb.net Pin
Richard Deeming25-May-17 1:01
mveRichard Deeming25-May-17 1:01 
GeneralRe: Cannot get data to display in textbox from the database vb.net Pin
NotPolitcallyCorrect25-May-17 2:39
NotPolitcallyCorrect25-May-17 2:39 
SuggestionRe arranging the display on the list view Pin
Member 1257814219-May-17 9:03
Member 1257814219-May-17 9:03 
GeneralRe: Re arranging the display on the list view Pin
Richard MacCutchan19-May-17 21:30
mveRichard MacCutchan19-May-17 21:30 
QuestionConnecting to remote server <IP> failed with the following error message. Pin
Y_Kaushik19-May-17 2:54
Y_Kaushik19-May-17 2:54 
AnswerRe: Connecting to remote server <IP> failed with the following error message. Pin
Richard Deeming23-May-17 1:28
mveRichard Deeming23-May-17 1:28 
QuestionCalling a Console Application with Elevated rights opening Windows continuously Pin
indian1431-May-17 8:59
indian1431-May-17 8:59 
Hi,

I have a console Application (AppA) which is calling another Console Application (AppV) with Elevated rights, problem is when I run the first Application AppA its opening many Consoles of AppB without limit continuously.
Here is my Code, any advice is going to be very helpful, thanks in advance.
    class Program
    {
        public static int ERROR_CANCELLED { get; private set; }

        private static bool IsRunAsAdmin()
        {
            WindowsIdentity id = WindowsIdentity.GetCurrent();
            WindowsPrincipal principal = new WindowsPrincipal(id);

            return principal.IsInRole(WindowsBuiltInRole.Administrator);
        }

        static void Main(string[] args)
        {
            if (!IsRunAsAdmin())
            {
                ProcessStartInfo proc = new ProcessStartInfo(@"C:\Personal Docs\FileWatcherBackups\20170221\FileWatcher\FileWatcherScheduleApp\bin\Release\FileWatcherScheduleApp.exe");
                proc.UseShellExecute = true;
                proc.WorkingDirectory = Environment.CurrentDirectory;
                proc.FileName = Assembly.GetEntryAssembly().CodeBase;
                proc.WindowStyle = ProcessWindowStyle.Normal;
                //proc.FileName = myExePath;
                proc.CreateNoWindow = false;
                //proc.UseShellExecute = false;

                proc.Verb = "runas";

                try
                {
                    Process.Start(proc);
                }
                catch (Win32Exception ex)
                {
                    if (ex.NativeErrorCode == ERROR_CANCELLED)
                    { }
                    else
                    { }
                }
                catch
                {
                    Console.WriteLine("This application requires elevated credentials in order to operate correctly!");
                }

                Application.Exit();
           }
        }
    }

Where am I going wrong, is there any way I can control the calling of AppB from AppA here?

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: Calling a Console Application with Elevated rights opening Windows continuously Pin
Dave Kreskowiak1-May-17 9:47
mveDave Kreskowiak1-May-17 9:47 
GeneralRe: Calling a Console Application with Elevated rights opening Windows continuously Pin
indian1431-May-17 10:04
indian1431-May-17 10:04 

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.