|
|
Set the MultiLine property of TextBox to True as given here
http://msdn.microsoft.com/en-us/library/12w624ff.aspx[^]
for showing and editing multiple lines. Then the following code can be used to read all the text from the inputFile to the TextBox and then to save the modified text from the TextBox to the outputFile
TextBox1.Text = System.IO.File.ReadAllText(inputFileName);
System.IO.File.WriteAllLines(outputFileName, TextBox1.Text);
|
|
|
|
|
+5 for short and to the point answer
Happy Coding...
modified 12-Apr-12 3:06am.
|
|
|
|
|
|
You need StreamReader to read the data from file and show into text box, Here is the code snippet for that:
sr = new StreamReader(filename);
while (!sr.EndOfStream)
{
if (txtBox.Text.Trim() == "")
{
txtBox.Text = sr.ReadLine();
}
else
{
txtBox.Text = txtBox.Text + Environment.NewLine + sr.ReadLine();
}
}
Note: TextBox Should be Multiline, replace the "filename" with your file location and you must include:
using System.IO;
Now for saving the data, you need to write the text of textbox in file. For that ou need StreamWriter. For this You can take the reference from following link:
http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx[^]
Happy Coding...
|
|
|
|
|
Hi all
I am having a picture box with a world map image of size 1800*3600 in it. Now I would like to create heat maps at different points based on latitude and longitude positions and the intensity of heat maps should be different for each point.
can anyone help me in designing the above said feature
thanks
|
|
|
|
|
|
The key point is, I think, to map or translate the GPS coordinates with the XY coordinates of your image.
image top left = XY (0,0) and corresponds to GPS (?, ?)
bottom right = XY (3600, 1800) and corresponds to GPS (?, ?) (assume x=3600 and y=1800)
(and everything in between).
You might want to opt to move the base (XY 0,0) with the GPS 0,0.
Hope this helps.
V.
|
|
|
|
|
Do you have a specific question?
|
|
|
|
|
I have load a xml file data to application. which is the best way to load the data 1) dataset load 2) XML Serialization 3) XMLDocument
Xml has defined data only, but have around one mb data...
|
|
|
|
|
I use XmlDocument, but it depends on your needs.
|
|
|
|
|
|
|
I want to integrate my Window application with Google Map to show the users(Which are basically locations) of my application in he Google map along with the tool tip to show whether a certain user/location has marked his attendance or not
|
|
|
|
|
|
I want to show mu users(which are basically locations) in to the google map along with the tool tip to show whether they have marked attendance or not.
|
|
|
|
|
How we can check whether exchange server is installed in a system using c#.
|
|
|
|
|
I want to store hash table in compound file.Is there any way to do that? Presently i am storing hash table in .dat file using BinaryFormatter class.
|
|
|
|
|
Member 8143513 wrote: I want to store hash table in compound file.
What is a compound file?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
"
used in a variety of programs from Microsoft Word and Microsoft Access to Business Objects
"
but now they use XML.
|
|
|
|
|
Very interesting but are you sure that's what OP means?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I need to change a registry value using a console c# app. I am getting an error though but from what i see, the code is alright, any suggestions?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace ChangeHomepage
{
class Program
{
static void Main(string[] args)
{
RegistryKey rkHKLM = Registry.CurrentUser;
RegistryKey rkRun;
String site = "whatever site";
String regPath =("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main");
rkRun = rkHKLM.OpenSubKey(regPath, true);
rkRun.DeleteValue("Start Page", true );
rkRun.SetValue("Start Page", site, RegistryValueKind.String);
Registry.CurrentUser.Flush();
}
}
}
|
|
|
|
|
MitchG92_24 wrote: I am getting an error though
Sharing the details of the error message will help us to help you...
|
|
|
|
|
Hello
I have an application that is basically built on Tab control. I have 8 tabs and i need to have different domains(e.g Admin, clerk, bursar, secretary) on my login where when a user under a specific domain clicks on a certain tab, an event is generated that prevents him from viewing the content of that tab
Any advice please???
|
|
|
|