Click here to Skip to main content
15,908,172 members
Home / Discussions / C#
   

C#

 
GeneralRe: convert structure to IntPtr [modified] Pin
amirreza_nl6-Mar-08 6:05
amirreza_nl6-Mar-08 6:05 
AnswerRe: convert structure to IntPtr Pin
Martin Cook6-Mar-08 10:17
professionalMartin Cook6-Mar-08 10:17 
GeneralRe: convert structure to IntPtr Pin
amirreza_nl6-Mar-08 22:59
amirreza_nl6-Mar-08 22:59 
GeneralRe: convert structure to IntPtr Pin
amirreza_nl6-Mar-08 23:15
amirreza_nl6-Mar-08 23:15 
QuestionHelp me ! Pin
banghv2-Mar-08 0:37
banghv2-Mar-08 0:37 
GeneralRe: Help me ! Pin
Not Active2-Mar-08 3:27
mentorNot Active2-Mar-08 3:27 
GeneralRe: Help me ! Pin
banghv2-Mar-08 14:34
banghv2-Mar-08 14:34 
QuestionHow to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 0:24
Walaza2-Mar-08 0:24 
D'Oh! | :doh: Can someone please help me to open a file in the application using openFileDialog. I have a button "Open File" > which then opens an openFileDialog window, I then select the file and click Open, but it does not want to open. I do get the path and everything, but it does not want to open. Maybe I am using the wrong code. Here is a snippet of my code:
//Opens the file and populates the datagrid
private void btnOpenFile_Click(object sender, EventArgs e)
{
ofdExcelDoc.Filter = "xls files (*.xls)|*.xls|All files (*.*)|*.*";

if (ofdExcelDoc.ShowDialog() == DialogResult.OK)
{
ofdExcelDoc.OpenFile();
try
{
// Attempt to open the file and output its contents to a text box
Stream stream;
if ((stream = ofdExcelDoc.OpenFile()) != null)
{
StreamReader reader = new StreamReader(stream);
//dgFileInfo.DataSource = reader.ReadToEnd();
txtOutput.Text = reader.ReadToEnd();
stream.Close();
}
}
catch (Exception ex)
{
MessageBox.Show("There was an Error: " + ex.Message);
}

}
}
}

Mvelo Walaza
Developer
Telkom SA
AnswerRe: How to open a file in the application using openFileDialog Pin
buchstaben2-Mar-08 2:45
buchstaben2-Mar-08 2:45 
AnswerRe: How to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 4:54
Walaza2-Mar-08 4:54 
AnswerRe: How to open a file in the application using openFileDialog Pin
Xmen Real 2-Mar-08 6:39
professional Xmen Real 2-Mar-08 6:39 
GeneralRe: How to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 6:54
Walaza2-Mar-08 6:54 
GeneralRe: How to open a file in the application using openFileDialog Pin
Xmen Real 2-Mar-08 6:54
professional Xmen Real 2-Mar-08 6:54 
Generalexplosion with xna Pin
e_za_sbc1-Mar-08 23:48
e_za_sbc1-Mar-08 23:48 
GeneralRe: explosion with xna Pin
User 66582-Mar-08 1:13
User 66582-Mar-08 1:13 
GeneralRe: explosion with xna Pin
e_za_sbc4-Mar-08 6:38
e_za_sbc4-Mar-08 6:38 
Generaldatagridview button problem ++ Pin
half-life1-Mar-08 22:32
half-life1-Mar-08 22:32 
GeneralRe: datagridview button problem ++ Pin
Xmen Real 1-Mar-08 23:06
professional Xmen Real 1-Mar-08 23:06 
GeneralRe: datagridview button problem ++ Pin
half-life2-Mar-08 0:06
half-life2-Mar-08 0:06 
GeneralRe: datagridview button problem ++ Pin
Xmen Real 2-Mar-08 1:26
professional Xmen Real 2-Mar-08 1:26 
GeneralRe: datagridview button problem ++ Pin
half-life2-Mar-08 2:54
half-life2-Mar-08 2:54 
GeneralRe: datagridview button problem ++ Pin
Xmen Real 2-Mar-08 3:41
professional Xmen Real 2-Mar-08 3:41 
GeneralRe: datagridview button problem ++ Pin
half-life2-Mar-08 4:32
half-life2-Mar-08 4:32 
GeneralRe: datagridview button problem ++ Pin
Xmen Real 2-Mar-08 4:59
professional Xmen Real 2-Mar-08 4:59 
GeneralRe: datagridview button problem ++ Pin
half-life2-Mar-08 7:47
half-life2-Mar-08 7:47 

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.