|
Thanks for the suggestion.
Now i am storing the information already as you said.But i feel that is not correct. That's fine when u come across any technique then let me know it.
thanks
Regards
.....Jack
|
|
|
|
|
Hi,
I want to save the last entered data for the fields like file name and location,output directory path in C# windows application.when the application exits it should save the last entered values, and load them again on the next application load.
Please do the needful.Thanks in advance
With Regards
Mahesh
|
|
|
|
|
You need handle the form closing event and save the required information. What problem are you facing in this?
|
|
|
|
|
Hi,
Where to save the required information ? Is it a file ?
And how to retrieve back when the application reload or Application start.
I'm not clear about your answer please provide some example
With Regards
Mahesh
|
|
|
|
|
his answer in a nutshell is, 'this is really trival, here's how it's done, why do you need to ask about this, where are you stuck'
In other words, he's asking you to show that you've done SOMETHING apart from asking us to do your job for you.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
I have save the reqiered information into text file.
Ex:1.Input file name and Path
2.Output folder path
this two information from the browse button.For first time application runs
this information are added through browse button and i have save same imformation into text file.
When the application start from next time i am reading from the file putting the currect information into respective browse button using user defined function and calling that function in the constuctor.
But the problem is i'm not able to load the application itself.
please help me.
With regards
Mahesh
|
|
|
|
|
This article [^]may help!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi!
Are you looking for the "official" C# way of saving program settings?
I know that it's different under .NET and with C# than the stupid method that Microsoft suggested before with Visual Studio 6 (before .NET) - put *EVERYTHING* in the registry!
I'm using the method below to store my program settings in my C# programs.
Windows Forms User Settings in C#[^]
From the books that I read, the above is the suggested method.
There are good/bad points with that method. *I* like storing a ".dat" file in the program directory. But, as I understand, with ***** Vista, and maybe with Windows 7, a user may not always be able to store a file in the programs directory (even if it's on the hard drive and a single user system). So, that's why the users application data area is used.
I use the above method to store the COM port number, program settings, user preferences, and so on. It may not be the best or fastest way. But, it works. And, it conforms to the accepted and suggested C#/.NET methods for storing/retrieving program data. So, if/when someone else looks at my code, it's not something unique or different than what's commonly done.
Good Luck!
________
Joe
|
|
|
|
|
2 ways to solution the problem
first one:
1)in your 'solution explore',choose 'properties'->'settings.settings' and double click to open it.
2)in the form of 'settings.settings', u can create parameters whitch you used to save data.
ps:for example: create a parameter named "filename" typed String.
3)using that parameter such as this code
Properties.Settings.Default.filename = &"c:\a.avi"
second one:
create a config file in local disk and save data to the config file.Then u can load the data for application from the config file when your application load.
good luck!
wjp_auhtm
|
|
|
|
|
Thank you very much.
I will go for second option. That's the exact requirement for me.
Even i'm new to .net application.And i have not done config file creation and how to use. I will try that if any problem comes i required your help
Once again thanks your answer.It's help me thank.
With Regard
Mahesh
|
|
|
|
|
1)u can search some infomation about creating/using file with ini suffix using the belowing code.
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
2)'DataTable' clsss have two methods named 'WriteXml' and 'ReadXml',u can also search the infomation about them.
3)u also can use FileStream class to create a config file.
good luck
wjp_auhtm@hotmail.com
|
|
|
|
|
Thank you very much
I got the answer
very need ful help
With regards
Mahesh
|
|
|
|
|
Hi everyone,
I want to ask is it possible to use visual C# to access a font (.TTF) and read the available character code value?
The program i want to do is to list out the available unicode script of the user selected font by detecting the code range that can be found in that particular font.
The list of script and their respective code range can be found here:
http://en.wikipedia.org/wiki/Mapping_of_Unicode_character_planes
thx.
|
|
|
|
|
hi,
i need to take a visio file and convert it to .pdf in a C# project. anyone could help?
|
|
|
|
|
There's lots of commercial libaries and some free ones, but I don't know how many work with Visio. You can use a PDF print driver to turn any file into PDF, tho
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi people!
I have been trying for days to populate a treeview from a particular structure.
The text file i have to work with is similar to this:
root
root/folder1
root/folder2
root/folder2/subfolder1
root/folder2/subfolder2/subfolder3
root/folder3/subfolder4
root/folder4
Which I can almost get to populate a treeview with. In fact, i can get to root/folder2/subfolder2/subfolder3, and then it wont display the root/folder3/subfolder4 because it hasnt created the root/folder3 path first!
There must be an easier way to do this!!!
Here's my '2 evenings of working on this now', code so far:
ArrayList paths = {the file split line by line into an arraylist}
private void Run()
{
treeView1.Nodes.Add("root");
Buildtree("root", treeView1.Nodes[0]);
}
private void Buildtree(String path, TreeNode parentNode)
{
ArrayList directories = GetDirectories(path);
if (directories.Count != 0)
{
foreach (string directory in directories)
{
TreeNode node = new TreeNode(directory.Remove(0, path.Length + 1));
parentNode.Nodes.Add(node);
Buildtree(directory, node);
}
}
}
private ArrayList GetDirectories(string parentPath)
{
ArrayList directories = new ArrayList();
foreach (string path in paths)
{
if (path.StartsWith(parentPath))
{
bool hasSubdir = false;
if (path.Contains('/') && (path.Length > parentPath.Length))
{
int startpos = parentPath.Length + 1;
string leftover = path.Substring(startpos, path.Length - startpos);
if (!string.IsNullOrEmpty(leftover) && leftover.Contains('/')) hasSubdir = true;
}
if (!hasSubdir && (path != parentPath))
directories.Add(path);
}
}
return directories;
}
Im going bonkers over this!!
|
|
|
|
|
0) Why are you using ArrayList instead of List?
1) That should be easy.
1.0) Use String.Split to split the string on '//'
1.1) Enumerate the resultant strings creating Nodes as necessary
|
|
|
|
|
Hi,
I just finished this little article[^] which may interest you.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Woo Hoo!! Luc, Thank you VERY much! You're amazing!
And thank you to all the others (one person) who came back with a slightly subdued answer.
Now to try the code myself...
|
|
|
|
|
Hi,
I just updated the little article[^] as I realized recursion wasn't really needed, a simple loop is sufficient.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Much better, smaller, cleaner, just the way I like it! Many thanks, Luc
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hallo
I wrote a small system tray application, and I would like to make it react to shortcuts.
How could I achieve this?
thanks in advance
|
|
|
|
|
I do not think that you can do that without hooking keyboard events globally.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
thank you Henry, I was actually looking in that direction...
|
|
|
|