Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › c# problem solved for now!
New Posts  All Forums:Forum Nav:

c# problem solved for now!

post #1 of 24
Thread Starter 
All done now, removed the code.

Thank you Farfnarkle!
Edited by LiLChris - 4/26/11 at 12:23pm
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
post #2 of 24
Not even remotely knowledgeable on C#, but wouldn't this work?

http://www.csharp-station.com/HowTo/...eTextFile.aspx
post #3 of 24
Thread Starter 
Hmm not sure how to code it in though.
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
post #4 of 24
If you are reading and writing back to the same file, instead of using File.ReadAllLines use a FileStream.

For example
Code:
using(FileStream file = File.Open(path, FileMode.OpenOrCreate))
{
  ...
}
You can then use a StreamReader or something similar on the FileStream to read lines from it and a StreamWriter to write lines back to it. Stream.Seek if you need to jump to a point in the file.


If you are just writing to a new text file, you can just use FileStream file = File.Create(path) or a StreamWriter directly.

In general it is better to open the stream yourself rather than simply passing a path string. (in the GDI+ based System.Drawing library, for example, you get significant memory leak by using the strings and eventually you will simply not be able to open any more images until a restart).
Edited by ghell - 4/23/11 at 11:27am
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
post #5 of 24
Thread Starter 
Never mind I figured out a different way.
+rep thanks anyways.
Edited by LiLChris - 4/23/11 at 1:44pm
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
post #6 of 24
Anyone with some C# knowledge would be helpful here... GUI and writing to a file in particular.
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
post #7 of 24
I have some experience, PM me?
Turbulence
(19 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5-2500k 4.4GHz Asus P8P67 Pro 3.1 HIS HD 7870 2GB G.SKILL Ripjaws X 16GB 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Crucial m4 128GB Samsung Spinpoint F3 1TB Asus DRW-24B1ST Noctua NH-D14 
CoolingOSMonitorKeyboard
Accelero Twin Turbo II Windows 7 Professional N Dell U2311H Realforce 87U White 55cN 
PowerCaseMouseMouse Pad
Corsair TX650V2 Fractal Design R3 Black Pearl Razer DeathAdder SteelSeries 4HD 
AudioAudioAudio
Audinst HUD-mx1 Beyerdynamic DT990 Premium 600 Ω Recabled M-Audio AV40 
  hide details  
Reply
Turbulence
(19 items)
 
  
CPUMotherboardGraphicsRAM
Intel i5-2500k 4.4GHz Asus P8P67 Pro 3.1 HIS HD 7870 2GB G.SKILL Ripjaws X 16GB 1600MHz 
Hard DriveHard DriveOptical DriveCooling
Crucial m4 128GB Samsung Spinpoint F3 1TB Asus DRW-24B1ST Noctua NH-D14 
CoolingOSMonitorKeyboard
Accelero Twin Turbo II Windows 7 Professional N Dell U2311H Realforce 87U White 55cN 
PowerCaseMouseMouse Pad
Corsair TX650V2 Fractal Design R3 Black Pearl Razer DeathAdder SteelSeries 4HD 
AudioAudioAudio
Audinst HUD-mx1 Beyerdynamic DT990 Premium 600 Ω Recabled M-Audio AV40 
  hide details  
Reply
post #8 of 24
Thread Starter 
Z wants to be complicated, still need help with something
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
>.<
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 930 4.0ghz 1.27v EVGA E758 3-Way (black/gray) Evga GTX 480 / Evga 9800gtx+ (physx&folding) Corsair Dominator 6gb 1600 8-8-8-24 
Hard DriveOSMonitorPower
x25-M SSD 80gb + 1TB F3 + 2x2TB WD Green Win 7 64bit Viewsonic 20" + Samsung 40" Corsair 1000w 
Case
Haf 932 (modded) - Now caseless 
  hide details  
Reply
post #9 of 24
OK, so a bit of expansion. I basically want a loop, where a name/number will show up in a message box, but then count down. So this is what I was gonna try:

for (int i = 0; i < 10; i++)
MessageBox.Show(i);

However, Chris tells me that just makes 10 message boxes pop-up instead...

Anyway of having the new message replace the old one instead?
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
Megadoomer
(14 items)
 
Family Computer
(13 items)
 
 
CPUMotherboardGraphicsRAM
Phenom II X6 1090T @ 4.0Ghz ASUS M4A89GTD PRO Sparkle GTS 450 2x4GB G-Skill Sniper 
Hard DriveCoolingOSMonitor
Samsung F1 1TB CM Hyper 212+ Windows 7 Professional x64 Samsung T220 
KeyboardPowerCaseMouse
Logitech MX3000 Laser CM 1000M HAF 922 Logitech VX Revolution 
CPUMotherboardGraphicsRAM
Q6600 Asus PN5-D 750i Evga GTS 250 2x2GB Crucial Ballistix 
Hard DriveOptical DriveOSMonitor
750GB Hitachi Samsung Super Writemaster Windows 7 Professional x64 19" Dell 
PowerCase
Corsair 450VX Antec 900 
  hide details  
Reply
post #10 of 24
Instead of having a message box pop up, have you tried creating a form and putting a label on it?
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › c# problem solved for now!