-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxt.cs
37 lines (33 loc) · 998 Bytes
/
txt.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace Proyecto_Reproductor
{
public partial class txt : Form
{
public txt()
{
InitializeComponent();
}
private void txt_Load(object sender, EventArgs e)
{
// Ruta del archivo de texto de canciones
string filePath = @"C:\Users\eduar\OneDrive\Escritorio\canciones.txt"; // Reemplaza con la ruta correcta de tu archivo
// Verifica si el archivo existe
if (File.Exists(filePath))
{
// Lee el contenido del archivo de texto
string[] canciones = File.ReadAllLines(filePath);
// Agrega las canciones al ListBox
listBox1.Items.AddRange(canciones);
}
}
}
}