Ciao,sono su un account amministrativo,quindi non ci son problemi di sorta quanto a permessi. Di file tbl non ne vedo e non so nemmeno a cosa servono,scusa ma sono totalmente nuovo al mondo .NET quindi non date niente per scontato! Io so solo che il libro da cui prendo l'esempio (risalente al 2002),crea questo programmino che dovrebbe leggere file mp3 e ha il codice qui sotto.
Volevo solo sapere se c'è qualcosa che non va nel mio pc (configurazioni,ecc) oppure se è una procedura vecchia e ora si fa in altre maniere.
using System;
using System.Windows.Forms;
using AxMediaPlayer;
public class MediaPlayerApp : Form {
private MainMenu mainMenu;
private MenuItem fileMenu;
private MenuItem fileOpen;
private MenuItem fileExit;
private OpenFileDialog openFileDialog;
private AxMediaPlayer.AxMediaPlayer mediaPlayerControl;
//Constructor
public MediaPlayerApp() {
//Adds media player control and sets some properties
mediaPlayerControl = new AxMediaPlayer.AxMediaPlayer();
mediaPlayerControl.Location = new System.Drawing.Point(8, 0);
mediaPlayerControl.Size = new System.Drawing.Size(285,305);
//Instantiate the open file dialog box.
openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "MP3 files (*.mp3)|*.mp3|AVI files (*.avi)
|*.avi |All files (*.*)|*.*";
openFileDialog.FileOk += new System.ComponentModel.CancelEventHandler
(this.openFileDialog_FileOk);
//Creates the File Menu
mainMenu = new MainMenu();
fileMenu = new MenuItem();
fileOpen = new MenuItem();
fileExit = new MenuItem();
//fileOpen
fileOpen.Text = "Open";
fileOpen.Index = 0;
fileOpen.Click += new
System.EventHandler(this.fileOpen_Click);
//fileExit
fileExit.Text = "Exit";
fileExit.Index = 0;
fileExit.Click += new
System.EventHandler(this.fileExit_Click);
//fileMenu
fileMenu.Text = "File";
fileMenu.Index = 0;
//Adds the Menu Items
fileMenu.MenuItems.Add(fileOpen);
fileMenu.MenuItems.Add(fileExit);
mainMenu.MenuItems.Add(fileMenu);
//Creating the Form Window
this.Text = "Media Player App";
this.AutoScaleBaseSize = new System.Drawing.Size(5,10);
this.ClientSize = new System.Drawing.Size(305,230);
this.Menu = mainMenu; //Sets the main menu for the form
//Adds the media player control to the form
this.Controls.Add(mediaPlayerControl);
}
//Handle the file open event
private void fileOpen_Click(object sender, System.EventArgs e) {
openFileDialog.ShowDialog();
}
//Handle the file exit event
private void fileExit_Click(object sender, System.EventArgs e) {
Application.Exit();
}
//Handles the file selection event
private void openFileDialog_FileOk(object sender, System.ComponentModel.CancelEventArgs e) {
//Sets the filename to be played
//by the media player control
mediaPlayerControl.FileName = openFileDialog.FileName;
}
public static void Main(){
Application.Run(new MediaPlayerApp());
}
}