titanpegasus Posted February 4, 2014 Share Posted February 4, 2014 C# da bir proje yapıyorum. Fakat yönetici iziniyle başlaması gerekiyor. Bilgisayarda visual studio 2012 pro yüklü. App.manifest dosyasından require administrator yapıyorum. Clickonce desteklemiyor gibi bir uyarı çıkıyor. Bunu nasıl çözerim? 2. bir sorunda butona basıldığında cmd de bir komut gerçekleşiyor. Bu komutu yönetici olarak nasıl başlatırım? Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted February 4, 2014 Share Posted February 4, 2014 Kodlarınızı paylaşırsanız daha iyi yardımcı olabiliriz. Quote Link to comment Share on other sites More sharing options...
titanpegasus Posted February 4, 2014 Author Share Posted February 4, 2014 Programda windows 8.1 keyini hızlı girmek için slmgr.vbs çalıştırmak istiyorum.Akşam ekran görüntülerini yollarım. Textboxdaki keyi komutla birlikte cmdye yolluyor . Butonun kodu System.Diagnostics.Process process = new System.Diagnostics.Process();System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;startInfo.FileName = "cmd.exe";startInfo.Arguments = "/C" + " slmgr.vbs -ipk " + textbox1.text;process.StartInfo = startInfo;process.Start(); Çalışıyor ama yönetici olmadığı için yapılamadı diye uyarı çıkıyor. Bunu nasıl yönetici olarak yapabilirim? Quote Link to comment Share on other sites More sharing options...
galetis Posted February 4, 2014 Share Posted February 4, 2014 System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = "cmd.exe"; startInfo.Arguments = "/C" + " slmgr.vbs -ipk " + textbox1.text; startInfo.Verb = "runas"; process.StartInfo = startInfo; process.Start(); Kodları böyle değiştirin ve manifest dosyanıza aşağıdaki satırı ekleyin.. <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> Quote Link to comment Share on other sites More sharing options...
titanpegasus Posted February 4, 2014 Author Share Posted February 4, 2014 İlginiz için teşekkürler ama app.manifest dosyasındaki satırı requireAdministrator değiştirince clickonce desteklemiyor gibi hata veriyor , derlemiyor. VS2012 Ultimate mi yüklemeliyim ? Quote Link to comment Share on other sites More sharing options...
galetis Posted February 4, 2014 Share Posted February 4, 2014 Birde böyle deneyebilirmisin System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = "cmd.exe"; startInfo.Arguments = "/C" + " slmgr.vbs -ipk " + textbox1.text; startInfo.Verb = "runas"; startInfo.UseShellExecute = true; process.StartInfo = startInfo; process.Start(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.