Moderator: xxSlayeRxx
private void button1_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.RootFolder = Environment.SpecialFolder.MyDocuments;
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
MessageBox.Show(fbd.SelectedPath);
}
static void Main(string[] args)
{
try
{
StreamReader myReader = new StreamReader("tekst\\Values.txt");
string line = "";
while (line != null)
{
line = myReader.ReadLine();
if (line != null)
Console.WriteLine(line);
}
myReader.Close();
}
catch
{
Console.WriteLine("Coś poszło nie tak z dostępem do pliku");
}
Console.ReadLine();
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace ListBox2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
DirectoryInfo dInfo = new DirectoryInfo(@"Bitmaps");
FileInfo[] Files = dInfo.GetFiles("*.png");
foreach(FileInfo file in Files)
{
listBox1.Items.Add(file.Name);
Path.GetDirectoryName(file.Name);
}
}
private void button1_Click(object sender, EventArgs e)
{
// Do oprogramowania
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string file = listBox1.SelectedItem.ToString();
string fullFileName = Path.Combine(@"Bitmaps", file);
pictureBox1.Image = new Bitmap(fullFileName);
}
}
}
Użytkownicy przeglądający ten dział: Brak zidentyfikowanych użytkowników i 10 gości