Click here to Skip to main content
15,901,894 members
Home / Discussions / C#
   

C#

 
Questionre: initialising a runtime class Pin
jdneul21-Sep-09 20:17
jdneul21-Sep-09 20:17 
AnswerRe: re: initialising a runtime class Pin
SeMartens21-Sep-09 20:26
SeMartens21-Sep-09 20:26 
AnswerRe: re: initialising a runtime class Pin
Mirko198021-Sep-09 22:24
Mirko198021-Sep-09 22:24 
GeneralRe: re: initialising a runtime class Pin
jdneul21-Sep-09 22:36
jdneul21-Sep-09 22:36 
GeneralRe: re: initialising a runtime class Pin
Mirko198021-Sep-09 23:51
Mirko198021-Sep-09 23:51 
GeneralRe: re: initialising a runtime class Pin
jdneul22-Sep-09 0:20
jdneul22-Sep-09 0:20 
GeneralRe: re: initialising a runtime class Pin
Mirko198022-Sep-09 3:31
Mirko198022-Sep-09 3:31 
QuestionArraylist problem!!! Pin
bounik21-Sep-09 18:28
bounik21-Sep-09 18:28 
i am new on C# and i need some help about arraylist argument out of exception problem please help me Cry | :((

and these are my codes ;

in Form1.cs;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{

public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
buton bt = new buton();
bt.kayit(@"C:\Users\Casper\Desktop\a.txt", textBox1.Text);
}
public void button2_Click(object sender, EventArgs e)
{
buton bt = new buton();
textBox2.Text = bt.okuyucu(@"C:\Users\Casper\Desktop\a.txt");
}
private void button3_Click(object sender, EventArgs e)
{
buton bt = new buton();
bt.silgi(@"C:\Users\Casper\Desktop\a.txt", Convert.ToInt16(textBox3.Text));
}
}
}



in buton.cs;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;


namespace WindowsFormsApplication3
{
class buton
{


int counter = -1;
List<string> silici = new List<string>();
public string okuyucu(string path)
{
string a = string.Empty;
StreamReader okuyucu = new StreamReader(path);
a = okuyucu.ReadToEnd();
okuyucu.Close();
return a;
}
public void kayit(string path, string text)
{
counter++;
string okur = string.Empty;
StreamReader okuyucu = new StreamReader(path);
okur = okuyucu.ReadToEnd();
okuyucu.Close();
StreamWriter yazıcı = new StreamWriter(path);
silici.Add(text);
yazıcı.WriteLine(okur + text);
yazıcı.Close();
Console.WriteLine(silici.Count);
}
public void silgi(string path, int silineceksirasi)
{
Console.WriteLine(silici.Count);
silici.RemoveAt(silineceksirasi); ----> I GET MİSTAKE WHEN ı CLİCK BUTTON3!!!
StreamWriter deleter = new StreamWriter(path);
deleter.Dispose();
deleter.Close();
for (int k = 0; k <= silici.Count - 1; k++)
{
string okur = string.Empty;
StreamReader okuyucu = new StreamReader(path);
okur = okuyucu.ReadToEnd();
okuyucu.Close();
StreamWriter yazıcı = new StreamWriter(path);
yazıcı.WriteLine(okur + silici[k]);
yazıcı.Close();
}
}
}
}

THANKS FOR YOUR HELPS Thumbs Up | :thumbsup:
GeneralRe: Arraylist problem!!! Pin
Programm3r21-Sep-09 20:09
Programm3r21-Sep-09 20:09 
GeneralRe: Arraylist problem!!! Pin
Luc Pattyn22-Sep-09 1:16
sitebuilderLuc Pattyn22-Sep-09 1:16 
GeneralRe: Arraylist problem!!! Pin
Programm3r22-Sep-09 1:27
Programm3r22-Sep-09 1:27 
AnswerRe: Arraylist problem!!! Pin
Calla21-Sep-09 20:27
Calla21-Sep-09 20:27 
AnswerRe: Arraylist problem!!! Pin
Programm3r21-Sep-09 20:30
Programm3r21-Sep-09 20:30 
GeneralRe: Arraylist problem!!! Pin
bounik21-Sep-09 21:48
bounik21-Sep-09 21:48 
AnswerRe: Arraylist problem!!! Pin
bounik21-Sep-09 21:42
bounik21-Sep-09 21:42 
AnswerRe: Arraylist problem!!! Pin
Calla21-Sep-09 22:21
Calla21-Sep-09 22:21 
GeneralRe: Arraylist problem!!! Pin
bounik21-Sep-09 22:36
bounik21-Sep-09 22:36 
GeneralRe: Arraylist problem!!! Pin
Calla21-Sep-09 22:41
Calla21-Sep-09 22:41 
AnswerRe: Arraylist problem!!! Pin
OriginalGriff21-Sep-09 22:33
mveOriginalGriff21-Sep-09 22:33 
GeneralRe: Arraylist problem!!! Pin
bounik21-Sep-09 22:46
bounik21-Sep-09 22:46 
GeneralRe: Arraylist problem!!! Pin
Amit Patel198521-Sep-09 23:23
Amit Patel198521-Sep-09 23:23 
QuestionExport and save dataset to excel Pin
kdwarak21-Sep-09 17:41
kdwarak21-Sep-09 17:41 
AnswerRe: Export and save dataset to excel Pin
Programm3r21-Sep-09 20:24
Programm3r21-Sep-09 20:24 
GeneralRe: Export and save dataset to excel Pin
kdwarak22-Sep-09 1:16
kdwarak22-Sep-09 1:16 
GeneralRe: Export and save dataset to excel Pin
Programm3r22-Sep-09 1:26
Programm3r22-Sep-09 1:26 

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.