here dan temel bir dosya iletişim örneği deniyorum ve 'Tamam' bir hata alıyorum ve nedenini bilmiyorum. bulunamadı'System.Nullable <bool>' 'OK' tanımı için anlam içermiyor
Hata 1 'System.Nullable' 'OK' ve hiçbir uzantı yöntemi 'Tamam' türü 'System.Nullable' bir ilk argüman kabul için bir tanım içermiyorsa (using yönergesi eksik Eğer
DialogResult
adlı bir yerel özelliği var gibi ya bir montaj referans?)
private void button1_Click(object sender, System.EventArgs e)
{
Stream myStream = null;
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = "c:\\" ;
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
openFileDialog1.FilterIndex = 2 ;
openFileDialog1.RestoreDirectory = true ;
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
if ((myStream = openFileDialog1.OpenFile()) != null)
{
using (myStream)
{
// Insert code to read the stream here.
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
}
}
}
sizin OpenFileDialog ne gibi montaj mı? –
Bu eser, biraz daha spesifik olabilir misiniz? Hata muhtemelen burada değil ... – jeroenh