|
LimitedAtonement wrote: You must be novice
Yes I'm learning new stuff every day.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Dear Sirs,
Oh!! I was wondering why my message didn't seem to hit its mark properly -- I meant to put a wink in there after `novice'!! I'm just kidding! Now I see that the wink was edited out...how do I get a little smiley face in the text? Sorry if this was taken wrong.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Hello Everyone, I am trying to add some components with my App. What it should do is during installation the App should ask user to create userName, password,and put the organization name that will use this App.
Since this is for the first time I am trying to deploy a project I do not have much knowledge about it. If some one be kind enough to help me that will be great.
Thaks
|
|
|
|
|
Have a look here[^]
only two letters away from being an asset
|
|
|
|
|
Hi Mark,
thanks for your reply. that is helpfull. Since I am rew to this that is why I need to little more time to absorb it. when user enter UserName, and Password How do I get it and save it in a file so that when the user want to log onto the App and get access to it using the same passwrod and user nanme.
Please forgive me if I miss read anything form the artical.
thanks.
|
|
|
|
|
|
I have used a dictionary before in the form of Dictionary<tkey, tvalue=""> but is it valid to use it like this, Dictionary(TKey, TValue, TValue), if not what is the best way to do this or a good alternative.
Thanks
|
|
|
|
|
What you are asking for is syntactically illegal in a .net Dictionary .
Formally a dictionary key directly maps onto the value (but not necessarily the reverse), and only one instance of key can exist per dictionary.
What you need to do depends up what you are trying to acheive, if you give more information I might be able to provide more help.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
I am reading in a txt file, and pulling out a drive name(string), start time (float), end time (float) and maybe a date in the future but not using that just yet. These will need to be stored. There will be more than one start and end time per drive. Once the data has been read in and stored I will need to then read the data back to make a graph out of the data.
Hope this is clear.
Thanks
|
|
|
|
|
You can use more complex types in a Dictionary, so you could have a Dictionary<string, List<float, float>> here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I think you need a class along the lines of
public class RetrievedTiming
{
public string Drive { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
}
How you store this depends upon whether you only get one timing per file or not. If there is only one timing per file , You could use Dictionary<string, RetrievedTiming> where the string is the filename.
If you have more than one timing per file the dictionary is no good, but you have a choice of either creating a class FileTimings which has the filename as a property and a List<RetrievedTiming> containing the timings from the file, or simply adding the commented Filepath property to the RetrievedTiming class and maintaining a list of this. [Edit] or, in line with Pete's Suggestion you could Have Dictionary<string, List<RetrievedTiming>> [/Edit]
Personally, I'd start with the last option (the List<RetrievedTiming> with the Filepath property)and develop around that (and replace it with the FileTimings based option if it becomes unweildy). One of the good things about the last option is that you can use LINQ to search the timings easily. See here[^] for a very brief introduction to using LINQ to search a list of objects(in this case an array, but it applies to generic lists too).
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
I have tried using Dictionary<string, list<float,="" float="">> = new Dictionary <string, list<float,="" float="">>(); but i get a compliation error
using the generic type 'System.Collections.Generic.List<t>' requires '1' type arguments
Any ideas.
Thanks
|
|
|
|
|
The syntax in your post is screwed up,
if you want to display > you have to type & g t ; (without the spaces) and similar for < as Code Project renders like web page
I can't help until I get the correct code, but it sounds like you are not declaring the generic properly. You can see examples in the previous posts.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
static Dictionary<string, List<float, float>> drive = new Dictionary<string, List<float, float>>();
this is the syntax im using.
Thanks for the help
|
|
|
|
|
The nested generic syntax is very powerful, but ugly (but I think there is no rational way around that problem) so errors are often difficult to spot, especially if you haven't used them very much.
The problem in the code snippet is List<float,float> you can only have one generic type in a list (e.g.
List<float> If you want to store two floats this way, you need to create a class with two float properties (Like the example I posted yesterday) e.g.
public class Foo
{
public float Value1 { get; set; }
public float Value2 { get; set; }
}
public class Program
{
public void Main()
{
Dictionary<string, List<Foo>> Bar = new Dictionary<string, List<Foo>>();
}
}
I suggest you research both generics, and the various common collection types (e.g. List, Collection, Dictionary, Linked List, Hashtable, Set etc.). The .Net framework doesn't have all these (e.g. I've had to implement a Set type), but a grounding in each will let you know when to use it and will stand you in good sted in your career.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
I use C# express edition 2008,windows XP sp2.
if In rowheader a datagridview i keydown delete key,I want the row to be deleted.
but i cannot trap the keydown event,
my question is how to do that.
thank you
han
han
|
|
|
|
|
If you have the AllowUserToDelete property (that may not be the exact name but it is pretty close, I'm doing this from memory) set to true then Ctrl-Del should do what you want.
Hope that this helps.
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.”
|
|
|
|
|
Hello Henry
thank you ,it work.
han 
|
|
|
|
|
Hi,
I Build an application with timer that is checking every second (on_Tick event)
if the second eq to "00",
and if it's true a messagebox launch with some message.
My problem is - if the user dosen't press OK the message will show again at the next minute (when the second will eq to "00").
How can i launch the messagebox only if there isn't any othere nessagebox.
10x
|
|
|
|
|
You'd have to either stop the timer until the message box has been shown, or you'd have to write your own message box class so you can set some sort of flag.
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.
|
|
|
|
|
Christian Graus wrote: you'd have to write your own message box class so you can set some sort of flag.
But if i'll stop the timer i don't think i can start it again,
can i?
and how i can check if the user press OK, with the Dialog Result?
Christian Graus wrote: or you'd have to write your own message box class so you can set some sort of flag.
Can I overrite it?
can you please explain me have to do it?
|
|
|
|
|
tamir901 wrote: But if i'll stop the timer i don't think i can start it again,
can i?
Why not ?
tamir901 wrote: and how i can check if the user press OK, with the Dialog Result?
A message box only has one button. So you show it, and the next line of code restarts the timer.
i think you need to buy a book, desperately.
tamir901 wrote: can you please explain me have to do it?
You either stop the timer, or you write your own dialog box. If you don't know how to create a form, you REALLY need to buy a book. The point is that your dialog box would include a flag, which is set to true while the form is visible, or you could just show and hide a static instance and check if it's visible directly.
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.
|
|
|
|
|
tamir901 wrote: But if i'll stop the timer i don't think i can start it again,
can i?
Yes, see below.
tamir901 wrote: and how i can check if the user press OK, with the Dialog Result?
Yes, just get back the DialogResult and compare it to one of the values in the DialogResult enum.
I don't mean to be doing your homework for you, but sometimes seeing it in code can make it easier to understand:
if (myCondition) {
timer1.Stop();
DialogResult result = MessageBox.Show("here is my message", "caption", MessageBoxButtons.OKCancel);
if (result == DialogResult.OK) {
} else {
}
timer1.Start();
}
Christian Graus wrote:
or you'd have to write your own message box class so you can set some sort of flag.
tamir901 wrote: Can I overrite it?
You could, but it's a lot easier just to follow Christian's first suggestion and stop and start the timer.
|
|
|
|
|
Hello everybody
Is possible to push a code project to a database server? The project has built in .Net framework that is .aspx, and it has written in c#. The server has no visual studio environment, it is just database server and contains Ms_Sql. If there is any clarity problem in my question I try to explain briefly. I forgot something, is the project should be published using publisher?
Thanks
|
|
|
|
|