PDA

View Full Version : بدست اوردن اطلاعات سیستم



habibsa
یک شنبه 29 بهمن 1391, 23:16 عصر
سلام
من میخام با کلیک بر روی دکمه, پنجره system information باز بشه100202

aryadad
یک شنبه 29 بهمن 1391, 23:25 عصر
private void StartSysInfo( string strSysInfo ) { try { Process.Start( strSysInfo ); } catch ( Win32Exception ex ) { MessageBox.Show ( this, ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } } // Start using LinkLabel control: private void lnkSysInfo_LinkClicked( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) { lnkSysInfo.Links[ lnkSysInfo.Links.IndexOf( e.Link ) ].Visited = true; StartSysInfo( e.Link.LinkData.ToString() ); } // Start on button click: private void cmdSysInfo_Click( object sender, System.EventArgs e ) { string strSysInfo = string.Empty; if( GetMsinfo32Path( ref strSysInfo ) ) StartSysInfo( strSysInfo ); }

aryadad
یک شنبه 29 بهمن 1391, 23:26 عصر
private void StartSysInfo( string strSysInfo ) { try { Process.Start( strSysInfo ); } catch ( Win32Exception ex ) { MessageBox.Show ( this, ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } } // Start using LinkLabel control: private void lnkSysInfo_LinkClicked( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) { lnkSysInfo.Links[ lnkSysInfo.Links.IndexOf( e.Link ) ].Visited = true; StartSysInfo( e.Link.LinkData.ToString() ); } // Start on button click: private void cmdSysInfo_Click( object sender, System.EventArgs e ) { string strSysInfo = string.Empty; if( GetMsinfo32Path( ref strSysInfo ) ) StartSysInfo( strSysInfo ); }

shahryari
یک شنبه 29 بهمن 1391, 23:32 عصر
Process.Start("msinfo32.exe" );

habibsa
دوشنبه 30 بهمن 1391, 00:18 صبح
private void StartSysInfo( string strSysInfo ) { try { Process.Start( strSysInfo ); } catch ( Win32Exception ex ) { MessageBox.Show ( this, ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } } // Start using LinkLabel control: private void lnkSysInfo_LinkClicked( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) { lnkSysInfo.Links[ lnkSysInfo.Links.IndexOf( e.Link ) ].Visited = true; StartSysInfo( e.Link.LinkData.ToString() ); } // Start on button click: private void cmdSysInfo_Click( object sender, System.EventArgs e ) { string strSysInfo = string.Empty; if( GetMsinfo32Path( ref strSysInfo ) ) StartSysInfo( strSysInfo ); }
ممنون از جوابتون
حالا اگه من بخام شرایط داخل cach رو بوجود بیارم باید چیکار کنم؟
منظورم اینه که من میخام پیغام خطا رو ببینم.(messagebox)

danialafshari
دوشنبه 30 بهمن 1391, 00:34 صبح
try
{
// دستورات
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}