|
I don't get it. The code to load the initial data to the form goes in the !IsPOstback block, not the code that you WANT to run on postback. That would go in an else block, surely ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You may try to store it on a local database or a file to be not reset,or if its not so much data you may store it in the Session collection till you copy it and then delete it again.
|
|
|
|
|
I need the user from windows, so i can ot get that because when i use Environment.UserName it returns ASP.net, i do not want that, i want the user that made a logon on windows, so if exists an API from windows that returns that, or any class from asp.net, please help me.
|
|
|
|
|
Your page will be executed under the ASP.NET account, so all methods that return the current user name will return ASP.NET.
You could try to get the user who started explorer.exe (process.StartInfo.UserName)
|
|
|
|
|
Hi ALL.
In C++ the const value write in *.h file (header).
I have a lot of const values that i need to include in my code , i can open new *.cs file and write them all in it - but does C#.NET support some file like *.h (header ) file that will contain all my const values ?
Thanks for the help.
|
|
|
|
|
I think you're doing it the right way. There is no concept of a header file in C#.
Rob Philpott
|
|
|
|
|
yanshof wrote: but does C#.NET support some file like *.h (header ) file that will contain all my const values ?
No. Put them inside your class, or create a class that contains them if you like. Make them static.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm keying a table on filename, and would like to preserve capitalization for the user since spaces aren't allowed in the name (ie FileNameWithMultipleWords). I'm using a filesystemwatcher to detect when other instances of the app modify the file to update timestamp info internally. The problem is that the fsw returns an all lowercase filename (the remainder of the path is properly capitalized), and 'FileNameWithMultipleWords' doesn't match with 'filenamewithmultiplewords' when I look for the old record.
|
|
|
|
|
No, you can't force the hashtable keys to be case insensitive. You can, on the other hand, force the keys to be lower case when you create the table entry. Just call the .ToLower() method of the filename string to return the lower-case version of the string before you put it into the hashtable.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That's what I thought, I'm using the filename as a the key though, and was hoping I could preserve the capitalization for UI use without having to modify my datastructure though.
|
|
|
|
|
You can use the lowercase version of the filename as your key, but store a structure in the value portion that contains the original filename with casing.
-David
Semper Ubi Sub Ubi
|
|
|
|
|
|
My issue wasn't with the drive letter but the filename itself. While I did have a hack to do the equivilant of the above it ended up affecting code elsewhere and I wanted to preserve the capitalization because WordsMashedTogether is easier to read than wordsmashedtogether.
|
|
|
|
|
I haven't tried it, but there is a
System.Collections.Specialized.CollectionUtil.CreateCaseInsensitiveHashtable method.
It looks like Hashtable takes an IHashCodeProvider and an IComparer in a few of its constructors.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Hmmm.... Never looked down there before. I'll have to experiment with that a little bit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That simplified things somewhat, but not a lot since I still need to get the mixed case version of the name when adding a new file, and when updating a new one. Because of the smallness (a few dozen files max) of the dataset I'm iterating across the entire folder/keyspace rather than trying to modify the datastructures since I'm not 100% conversant with how that section of the code works.
|
|
|
|
|
I wanted to know if anyone has the program for Graph Coloring or Map Coloring using Forward Checking.
|
|
|
|
|
hi i need code source of
graph coloring program
|
|
|
|
|
To all:
After calling Process.GetProcessById, I can get specific process. But how to get its window, and set the window position and size?
Below is my code.
Process selectedProcess = Process.GetProcessById(Int32.Parse(lvwWindows.SelectedItems[0].Text));
NativeWindow nw = NativeWindow.FromHandle(selectedProcess.MainWindowHandle);
Here, the second line return nothing. Why?
The target window is not managed coded.
Thanks a lot.;)
|
|
|
|
|
Hey
I would like to know if there is somekind of a possibilty to create an array WITHOUT knowing its size.
lets say I want to load an array from a file, but I do not know the size of the array that I am loading.
so my solution for this, is creating a huge array (like myarray[1000]), and load to it.
but if I'm just using 2 or 3 slots, its a waste of memory.
is there a way to do it a bit better? to tell what is the size of the saved array before I load it (the array is serialized)?
Thanks!
|
|
|
|
|
You can use the ArrayList-class
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks!
|
|
|
|
|
You can use a hash table for this as well. Here is an example:
<br />
Hashtable hash = new Hashtable(); <br />
for (int i=0; i<10; i++){ <br />
hash.Add(KeyHere, ValueHere); <br />
}<br />
Replace the KeyHere and ValueHere...
Dirk Watkins
|
|
|
|
|
now, thats a nice.
I''ve never used a hashtable, but I guess I will now
thx!
|
|
|
|
|
You do take a fair amount of memory overhead with a hashtable. The runtime keeps it at roughly 50% capacity for speed reasons. The advantage is that if you're modifying data regularly you don't need to resort with each insert. Search times are comparable with a sorted array.
|
|
|
|