settings file in windows mobile development.
-
quinta-feira, 12 de janeiro de 2012 02:29
BH
Hi, i'm creating an application for windows mobile using c# and visual studio. I've noticed that in the windows mobile enviroment there is no settings.settings file. How can i save certain data about the application? For example, can i save the date of when the first time the application ran on the windows mobile device?
thanks so much.
Aron
Thanks Aron www.EvidenceForTorah.comxa.com- Movido Yoyo JiangMicrosoft Contingent Staff terça-feira, 24 de janeiro de 2012 07:57 (From:Visual C# Language)
Todas as Respostas
-
quinta-feira, 12 de janeiro de 2012 14:52
You can write it to a file or to the registry. Compact Framework is missing a lot of the fancy stuff the full framework has, but all of the basic stuff is there.- Sugerido como Resposta servy42Microsoft Community Contributor quinta-feira, 12 de janeiro de 2012 16:08
-
sexta-feira, 13 de janeiro de 2012 04:20
BH,
Hi and thanks so much for your answer. I've tried to write to a textfile useing streamwrite, but the problem is that it is looking for a file in a different folder (not where the executable file is located). How do i make sure that the file it is reading from is infact in the same folder where the program file is? My code is below:
using (StreamReader TodaysPointsStream = new StreamReader("todayspoints.txt"))
{
string todayspoints = TodaysPointsStream.ReadLine();
}
using (StreamWriter RecordTodaysPoints = new StreamWriter("todayspoints.txt"))
{
RecordTodaysPoints.WriteLine(DateTime.Now.ToShortDateString());
}
Thanks Aron www.EvidenceForTorah.comxa.com -
segunda-feira, 16 de janeiro de 2012 08:08
Hi aniyahudi,
Welcome to the MSDN forum!Please look into the following link:
http://bytes.com/topic/net/answers/115705-how-get-current-directory-exe-cThen, you may try the following methods:
Application.StartupPath
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.startuppath.aspxAssembly.GetExecutingAssembly
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly.aspxPath.GetDirectoryName(System.Reflection.Assembly.G etExecutingAssembly().GetName().CodeBase)
Have a nice day!
yoyo
Yoyo Jiang[MSFT]
MSDN Community Support | Feedback to us
- Editado Yoyo JiangMicrosoft Contingent Staff terça-feira, 24 de janeiro de 2012 07:54
-
terça-feira, 24 de janeiro de 2012 07:56
Hi Aron,
I'm moving the thread to .NET Compact Framework for better support.
Thanks.
yoyo
Yoyo Jiang[MSFT]
MSDN Community Support | Feedback to us
-
quinta-feira, 9 de fevereiro de 2012 15:08
Hi,
You can save setting to you registry:
http://www.malleswar.com/viewarticle.aspx?articleid=16
-Malleswar

