winforms - writing from textbox to text file C# -


i want write textboxes in windows form textfile, want use spilt. want written in text file this

namelabel : nametextbox
passlabel : passtextbox

how can that!

streamwriter txt = new streamwriter("d:\\register.txt")              txt.write(namelabel.text);             txt.writeline(nametextbox.text);             txt.write(passlabel.text);             txt.writeline(passtextbox.text); 

you can use system.io.writealltext write text in file. example:

system.io.file.writealltext("d:\\register.txt",      string.format("{0}:{1}\n{2}:{3}"         namelabel.text,         nametextbox.text         passlabel.text         passtextbox.text)); 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -