当前位置: 首页>>代码示例>>C#>>正文


C# License.ShowDialog方法代码示例

本文整理汇总了C#中License.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# License.ShowDialog方法的具体用法?C# License.ShowDialog怎么用?C# License.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在License的用法示例。


在下文中一共展示了License.ShowDialog方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowWindow

        public static bool ShowWindow()
        {
            string keySW = "Software";
              string keyESRI = "ESRI";
              string keyDF = "DeedDrafter";
              string keyExecute = "Execute";

              string acceptValue = "{61F78689-7E9A-47CC-B8F0-DC4428AD4937}";

              RegistryKey regKeySW = Registry.CurrentUser.OpenSubKey(keySW);
              if (regKeySW != null)
              {
            RegistryKey regKeyESRI = regKeySW.OpenSubKey(keyESRI);
            if (regKeyESRI != null)
            {
              RegistryKey regKeyDF = regKeyESRI.OpenSubKey(keyDF);
              if (regKeyDF != null)
              {
            object value = regKeyDF.GetValue(keyExecute, "");
            if (value.ToString() == acceptValue)
              return true;
              }
            }
              }

              var license = new License();
              license.ShowDialog();

              if (license.Agreed)
              {
            // If we have any errors, allow the app to start, but
            // the user will have to accept the agreement again :(
            if (regKeySW == null)
              return true;

            try
            {
              regKeySW = Registry.CurrentUser.OpenSubKey(keySW, RegistryKeyPermissionCheck.ReadWriteSubTree);
              if (regKeySW == null)
            return true;

              RegistryKey regKeyESRI = regKeySW.OpenSubKey(keyESRI, RegistryKeyPermissionCheck.ReadWriteSubTree);
              if (regKeyESRI == null)
            regKeyESRI = regKeySW.CreateSubKey(keyESRI, RegistryKeyPermissionCheck.ReadWriteSubTree);
              if (regKeyESRI == null)
            return true;

              RegistryKey regKeyDF = regKeyESRI.OpenSubKey(keyDF, RegistryKeyPermissionCheck.ReadWriteSubTree);
              if (regKeyDF == null)
            regKeyDF = regKeyESRI.CreateSubKey(keyDF, RegistryKeyPermissionCheck.ReadWriteSubTree);
              if (regKeyDF == null)
            return true;

              regKeyDF.SetValue(keyExecute, acceptValue);
            }
            catch { }
              }

              return license.Agreed;
        }
开发者ID:Esri,项目名称:deed-drafter,代码行数:60,代码来源:License.xaml.cs

示例2: stackControl_StackControl_ItemSelected

		private void stackControl_StackControl_ItemSelected(string itemClicked)
		{
			switch (itemClicked.Trim().ToUpper() )
			{
				case "PROFILE DESKTOP APPLICATION.":				
				{					
					ProfilingSelector perfSelector=new ProfilingSelector(PROFILEE_TYPE.PROFILE_DESKTOP_APP);
					perfSelector.Show();
					break;
				}
				case "PROFILE WINDOWS SERVICE.":
				case "PROFILE ASP.NET":
				case "PROFILE COM+ APPLICATION.":
				{
					ProfilingSelector perfSelector=new ProfilingSelector(PROFILEE_TYPE.PROFILE_BACKGROUND_PROCESS);
					perfSelector.Show(); 
					break;
				}
				case "OPEN PERFORMANCE RESULTS.":
				{
					OpenPerformanceSession();
					break;
				}
				case "OPEN MEMORY RESULTS.":
				{
					OpenMemorySession();
					break;
				}
				case "COMPARE TWO MEMORY SNAPSHOTS.":
				{
					ComparisonSessionSelector comparisonDialog=new ComparisonSessionSelector();			
					comparisonDialog.ShowDialog(this);  	
					break;
				}				
				case "SUGGEST A FEATURE.":
				case "REPORT A BUG.":
				{
					try
					{
						string strExplorer=Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer\\iexplore.exe";				
						System.Diagnostics.ProcessStartInfo pInfo=new System.Diagnostics.ProcessStartInfo(strExplorer,"\""+"www.SoftProdigy.com\\Contact.aspx"+"\"");				
						pInfo.WorkingDirectory =Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer";
						pInfo.UseShellExecute =false;
						System.Diagnostics.Process.Start(pInfo);			
					}
					catch(Exception ex)
					{
						MessageBox.Show("Unable to connect to the website\n"+ex.Message+"\n You may need to visit www.SoftProdigy.com manually.","Error!");				
					}
		
					break;
				}
				case "ASK FOR A CUSTOMIZATION.":
				{
					try
					{
						string strExplorer=Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer\\iexplore.exe";				
						System.Diagnostics.ProcessStartInfo pInfo=new System.Diagnostics.ProcessStartInfo(strExplorer,"\""+"mailto:[email protected]?Subject=I need ProfileSharp to be customized to my requirements.Please do it so for me."+"\"");				
						pInfo.WorkingDirectory =Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer";
						pInfo.UseShellExecute =false;
						System.Diagnostics.Process.Start(pInfo);			
					}
					catch(Exception ex)
					{
						MessageBox.Show("Unable to connect to SoftProdigy.\n"+ex.Message+"\n Please drop in a mail to [email protected] with 'Product Customization Required' as subject.","Error!");				
					}
		
					break;
				}
				case "VIEW HELP FILE.":
				{
					OpenProductDocumentation();
					break;
				}
				case "PROFILESHARP LICENSE AGREEMENT.":
				{
					try
					{
						License license=new License();
						license.ShowDialog(this); 
					}
					catch(Exception ex)
					{
						MessageBox.Show("Unable to show the 'License-Agreement'\n"+ex.Message+"\n You may need to visit SoftProdigy's official website to acknowledge the 'License-Agreement'. ","Error!");				
					}
					break;
				}
				case "CHECK FOR UPDATES.":
				{
					try
					{
						string strExplorer=Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer\\iexplore.exe";				
						System.Diagnostics.ProcessStartInfo pInfo=new System.Diagnostics.ProcessStartInfo(strExplorer,"\""+"www.SoftProdigy.com"+"\"");				
						pInfo.WorkingDirectory =Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles)+"\\Internet Explorer";
						pInfo.UseShellExecute =false;
						System.Diagnostics.Process.Start(pInfo);			
					}
					catch(Exception ex)
					{
						MessageBox.Show("Unable to connect to the website\n"+ex.Message+"\n You may need to visit www.SoftProdigy.com manually.","Error!");				
//.........这里部分代码省略.........
开发者ID:corefan,项目名称:ProfileSharp,代码行数:101,代码来源:SharpClientForm.cs

示例3: menuItem10_Click

		private void menuItem10_Click(object sender, System.EventArgs e)
		{
			
			try
			{
				License license=new License();
				license.ShowDialog(this); 
			}
			catch(Exception ex)
			{
				MessageBox.Show("Unable to show the 'License-Agreement'\n"+ex.Message+"\n You may need to visit SoftProdigy's official website to read the 'License-Agreement'. ","Error!");				
			}
		}
开发者ID:corefan,项目名称:ProfileSharp,代码行数:13,代码来源:SharpClientForm.cs

示例4: Chat_Refresh

        private async Task Chat_Refresh()
        {
            try
            {
                String machine_id = "";
                if (Properties.Settings.Default.license_id == "")
                {
                    machine_id = await Task.Factory.StartNew(() => FingerPrint.Value());
                    Properties.Settings.Default.license_id = machine_id;
                    Properties.Settings.Default.Save();
                }
                else
                {
                    machine_id = Properties.Settings.Default.license_id;
                }

                HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(CHAT_URL + "?id=" + machine_id);
                myRequest.Method = "GET";
                WebResponse myResponse = await myRequest.GetResponseAsync();
                StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
                string result = sr.ReadToEnd();
                string[] _results = result.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                string new_version = _results[0];
                txtChatLog.Text = result.Replace(_results[0] + "\r\n", "");
                sr.Close();
                myResponse.Close();

                if (result == "trial?")
                {
                    Program.loadingForm.RequestStop();
                    if (MessageBox.Show("Bạn có muốn kích hoạt bản dùng thử trong 3 ngày ngay bây giờ? Nếu bạn đã mua bản quyền, hãy chọn NO", "Kích hoạt bản dùng thử", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                    {
                        myRequest = (HttpWebRequest)WebRequest.Create(CHAT_URL + "?id=" + machine_id + "&trial=1");
                        myResponse = await myRequest.GetResponseAsync();
                        myResponse.Close();
                        MessageBox.Show("Bạn đã kích hoạt thành công! Nhấn OK để đóng chương trình! Khởi động lại để sử dụng phiên bản dùng thử 3 ngày!");
                        Process.GetCurrentProcess().Kill();
                    }
                    else
                    {
                        License licForm = new License();
                        licForm.ShowDialog();
                        Process.GetCurrentProcess().Kill();
                    }
                }

                if (result == "DENIED")
                {
                    Program.loadingForm.RequestStop();
                    MessageBox.Show("Vui lòng gia hạn bản quyền!\nBản quyền của bạn đã hết hạn sử dụng!");
                    License licForm = new License();
                    licForm.ShowDialog();
                    Process.GetCurrentProcess().Kill();
                }

                if ("Version: " + new_version != lblVer.Text)
                {
                    Program.loadingForm.RequestStop();

                    if (MessageBox.Show("Có phiên bản mới hơn của ứng dụng (" + new_version + "). Nhấn OK để tải về!", "Cập nhật phiên bản mới", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes)
                    {
                        System.Diagnostics.Process.Start("http://ipostfb.com/downloads");
                    }
                }

            }
            catch
            {
                Program.loadingForm.RequestStop();
                MessageBox.Show("Không thể kết nối đến Server! Vui lòng thử lại trong giây lát hoặc liên hệ với chúng tôi để được hỗ trợ!");
                Process.GetCurrentProcess().Kill();
            }
        }
开发者ID:mohamedgpaly,项目名称:KSTN-Facebook-Tool,代码行数:73,代码来源:MainForm.cs

示例5: btnLicense_Click

 private void btnLicense_Click(object sender, EventArgs e)
 {
     License licForm = new License();
     licForm.ShowDialog();
 }
开发者ID:mohamedgpaly,项目名称:KSTN-Facebook-Tool,代码行数:5,代码来源:MainForm.cs

示例6: LicenseCallButton_Click

 private void LicenseCallButton_Click(object sender, EventArgs e)
 {
     License open_license = new License();
     open_license.ShowDialog();
 }
开发者ID:DasunSL,项目名称:HotelManagement,代码行数:5,代码来源:Login.cs

示例7: tsmi_help_About_Click

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsmi_help_About_Click(object sender, EventArgs e)
        {
            bool bShowLicense = false;

            // Show the application about box form.
            using (AboutBox oForm = new AboutBox())
            {
                if (oForm.ShowDialog(this) == DialogResult.OK)
                    bShowLicense = true;
            }

            // Show the license form if specified.
            if (bShowLicense)
            {
                using (License oForm = new License())
                    oForm.ShowDialog(this);
            }
        }
开发者ID:samuraitruong,项目名称:comitdownloader,代码行数:23,代码来源:MainWindow.cs

示例8: licenceToolStripMenuItem_Click

 private void licenceToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var licence = new License();
     licence.ShowDialog();
 }
开发者ID:qkostal,项目名称:program,代码行数:5,代码来源:FormMain.cs


注:本文中的License.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。