
C# problem, jak to zpravit?
Ahoj lidičky,
nevíte jak zpravit chybu?
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.IO;
using System.Windows.Forms;
namespace Downloader
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string working_directory = Directory.GetCurrentDirectory()+"/text.txt";
System.IO.StreamReader file = new System.IO.StreamReader([b]working_directory[/b]);
...
}
}
Jaku chybu?
Zde: System.IO.StreamReader file = new System.IO.StreamReader(working_directory);
Akú hodnotu má tá Tvoja premenná working_directory?
Skús si ju vypísať (predtým, než s ňou chceš niečo robiť) a budeš vedieť...
Tipujem ze tam strkas nejaky kod (t.j. ten cely riadok) uplne mimo funkcie. (on ti to tam pise ze co robis blbo). Nema to nic s working_directory.