|
That is excellent, thanks Pete.
|
|
|
|
|
No problem. It's a lot prettier than ours.
|
|
|
|
|
One shouldn't make an unappealing document about HTML5, it would defeat its purpose.
|
|
|
|
|
Hi Luc,
This isn't a list, but the w3schools[^] site states the supported browsers for each of the various HTML5 goodies in the reference section.
|
|
|
|
|
Thanks Dave.
|
|
|
|
|
Thanks, but i must do it on codebehind and return as image, i posted a sample code producing a cube but I'm stucked now...
|
|
|
|
|
Hi,
I'm about to start on a new project and want to get a good starting point. What is the issue with .ini files why have they been replaced with XML and what is the best way of using them I have had a look and haven't found any real reason.....
Glenn
a good example would help had a look on CP didn't find one!
|
|
|
|
|
|
Easiest way is to use the .NET settings mechanism:
1) Open your projects Properties in the solution explorer, and double click on "Settings.settings"
2) In the resulting grid, change the Name to "MySetting", and set the Value to "Defaulted value". Leave Type and Scope as "string" and "User" respectively.
3) Save and close the settings window.
4) To read your setting:
string s = Properties.Settings.Default.MySetting;
5) To write your setting:
Properties.Settings.Default.MySetting = "My new setting value";
Properties.Settings.Default.Save();
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Note that one problem with that idiom is that the configuratoin file is no longer really a 'configuration' file.
The reason for that is that there is no way to add documentation and/or formatting to that file because if you touch it in the IDE again then all of those changes are lost.
And so expecting someone to use that file via something like notepad to set up an application will not really work if there are more than a couple of values.
|
|
|
|
|
I agree - but I would not expect to make a user manually edit a config file anyway. Heck, most of them couldn't be trusted to get it right! And I'd prefer to document the settings where they are used, rather than where they are stored. The settings are no use without the program, but the program can be used without the settings file if you have info on what they are for.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
I write servers. And the targetted users are paid to get it right but I code defensively to insure logical behavior for mistakes.
The settings are not intended to be modified on a regular basis. Providing an alternative way to edit them would be significantly additional work. And it doesn't insure that problems will not occur since the file can still be manually edited.
|
|
|
|
|
What I don't like about that is that I find it very limiting in what you can do with it. Whereas, by rolling my own, I can have exactly the flexibility I want, rather than what Microsoft thought I would want. For example, I have applications sharing config files and config files that refer to other config files.
And, like jschell pointed out, I prefer to be able to edit my config files when the need arises without fear that some tool will wipe out my changes. That doesn't mean I require my users to do so as well, only that they can if they need to (not that I have any users anyway).
|
|
|
|
|
It is limited - but is is simple, and quick to set up and use.
For simple tasks, it is fine - for more complex stuff I roll my own, but that would be more likely to be a datafile or a template than an INI file anyway.
No users? Lucky you! They just pay you to produce software nobody uses?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Sooo...,
For maximum flexibly still the old ground hugging ini file is best it appears to the best, users can open see and scr*w up!
if (File.Exists(INIPath + "\\MeteringData.ini"))
{
StreamReader sr = new StreamReader(INIPath + "\\MeteringData.ini");
Defaults = sr.ReadToEnd();
sr.Close();
string[] Values = Defaults.Split(delimetersChars);
foreach (string v in Values)
{
a++;
char[] separator = { '=' };
string[] Key = v.Split(separator);
if (Key.Length != 2) continue;
Key[0] = Key[0].Trim();
Key[1] = Key[1].Trim();
if(Key[0] == "Location")
{
LocationData = Key[1];
}
The really nice thing is when you get a panic stricken email/phone call "we have broken something help" send them a fresh version of the ini file modded to their specs and 'Hussar!' it works.
Glenn
|
|
|
|
|
glennPattonWork wrote: For maximum flexibly
XML.
|
|
|
|
|
XML, really? I need a good example of how to do it, also with our clients editing/modding the file must be stupidly easy. The number times I have received an Email at quarter to home on Friday that basically says "<thing> does not run we need <thing> running for a demo on Saturday am", (I mean a Demo on Saturday morning?)....
|
|
|
|
|
glennPattonWork wrote: with our clients editing/modding the file must be stupidly easy.
Write an editor for them to use and/or have something like Tools/Options.
|
|
|
|
|
That depends on the product and user base but defensive programming can minimize many problems.
|
|
|
|
|
OriginalGriff wrote: produce software nobody uses
Batch processing, Windows Services, etc.
And stuff that I write for myself that no one else uses.
|
|
|
|
|
Hi Gurus,
I am using RegEx class for parsing some strings of the following format
[Hello World message 234...]
What is the expression that I need to use to format the above string??
Thanks...
Sunil
|
|
|
|
|
What do you mean by "formatting the above string"??
Are you looking to pull information out of the string?? What would that data be??
|
|
|
|
|
Hi Dave,
This is my requirement. I read a line from a file, which is in the following format: [Some message 123...]
So I would want to create a RegEx pattern for the above format. What would be the expression for this case. I tried this but it failed while calling method RegEx.Match():
RegEx _exp = new Regex(@"^\[(?<message>\w+)]", RegexOptions.IgnoreCase);
Sunil
|
|
|
|
|
That still doesn't help. Why do you need a regex, what problem is it supposed to solve?
|
|
|
|
|
sunilkpv wrote: So I would want to create a RegEx pattern for the above format
TO DO WHAT??
|
|
|
|