|
How so? Ive never used SortedList and i cant really see how it works and helps. Any tips?
I haven't lost 'till I'm the last one to cross the finishline.
|
|
|
|
|
Start by reading up on it.
|
|
|
|
|
Write your own comparer and call that in the Sort method's parameters. Array.Sort(StringComparer);
public int StringComparer(string stringA, string stringB)
{
return stringA.CompareTo(stringB);
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
You have to make your own custom comparer that splits the strings into numerical and non-numerical parts and compares them, which you then use with the Array.Sort method.
You can use a regular expression to split the strings.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks. I ended up creating a custom IComparer class which works perfectly. Well... So far atleast
I haven't lost 'till I'm the last one to cross the finishline.
|
|
|
|
|
Im just playing round with LINQ for the first time, so here i'll show you that solution.
You'll see this test code outputs the 3 numbers 3 times
1) Original Order
2) Default Sort which is the wrong order for you
3) Ordered using the first group of numbers followed by the second group of numbers - this should be the order you're looking for
string[] myStrings = { "123_456", "123_12", "123_123567" };
foreach (string s in myStrings)
Console.WriteLine(s);
Console.WriteLine();
Array.Sort(myStrings);
foreach (string s in myStrings)
Console.WriteLine(s);
Console.WriteLine();
var sortedRight = from s in myStrings.OfType<string>()
orderby int.Parse(s.Split('_')[0]), int.Parse(s.Split('_')[1])
select s;
foreach(string s in sortedRight)
Console.WriteLine(s);
Console.ReadLine();
Output:
123_456
123_12
123_123567
123_12
123_123567
123_456
123_12
123_456
123_123567
|
|
|
|
|
# Cloning Outlook pst:
This is what the app is about - we're trying to clone the Outlook pst and maintain a mirror image. Initially we'll need to clone the structure and copy each item from the original Outlook pst. This is the first time the user accesses our app. For each subsequent access we'll only compare both the psts and add what is new in the Outlook pst. This is like physically maintaining a backup copy of the original pst.
The idea is to keep this copy in a flash-drive which will make everything portable (we don't want that everytime the user wants to carry all his email - he needs to copy-paste the huge pst file - it is sensitive so we dn't want to touch it)
# Platform:
We've started with .Net but it seems that using the native MAPI is what most of the coders suggest. That is deploy this app using VB6 or C++.
For now we're relying on the OOL (Outlook Obj Lib) - though its version specific but we can handle it. We've also tried assesing tools like mapi33.dll, Outlook Redemption, etc.. but most of them don't seem to be stable or lack pst-file manipulation.
we need something which provides full-features pst-access and manipulation.
Any material, code or suggestion?
Thanks in advance
thx,
hmnt
|
|
|
|
|
I have 2 projects one is web service project and the other is windows service project
i want to make a setup project which install the both projects in one click ???
any advices
P.S i tried to put the both project in one solution and then created a setup project for the solution but it didn't work also i tried to make another two merge module projects for each of them and added the 2 merged project to a setup project but when i started the install i got an error message says " This Setup Requires Internet Information Server 4.0 or higher and Windows NT 4.0, Windows 2000 or higher. This setup cannot be installed on Windows 95, Windows 98 ,or Windows Me. Please Internet Information Server and run this setup again." and i've already have IIS and Windows server 2003 on my machine
Thank You
|
|
|
|
|
Hi,
I am new here and in the world of C#. And now I have a problem with a textbox and the autocomplete properties. To fill my AutoCompleteStringCollection, I use MS SQL and this works. Also the AutoComplete works with the textBox. The only thing I want is, that you can push the down key ( Keys.Down ) and the AutoCompleteList is shown. Especially if the textBox is empty. I don't know if there is a method or an property but I don't find something belongs this. Please help me.
KeDaiv
|
|
|
|
|
Guys, Girls,
I'm searching the web a bit in order to automate some things we need to do when creating a new project in VS2005.
I was able to create a custom template and that works, however it's too basic for our needs.
I kept on searching and found you can create your own wizard. That's exactly what I want. Double click my project 'template', have a dialog that allows you to select some options and create a project with the correct references and code immidiately attached. I found a tutorial and followed it right down to the bottom, until I discovered that it was for VS 2003 (well, in fact I noticed right away, but I didn't figure that it would be such a difference).
The problem is that I can't seem to find a VS 2005 tutorial. I found some that claim to be for 2005, I found some for VB and C++, but no C#. (the languages seem te be built up differently in VS)
Can anybody point me out to a good tutorial?
basicly I need a basic win or web or library template (chosen in the wizard) and add references of some dll's (also chosen in the wizard). Furter I would already like to create some code like first log entry etc...)
thanks a lot for your help.
PS: This is the one I was following thus far [^]
|
|
|
|
|
|
thanks, I'm still having trouble, but at least the message box already appeared.
Now I'll have to open up some template files, modify and add code via my wizard dialog and add them the project/solution...
|
|
|
|
|
Does such a thing exist? Preferably freeware.
|
|
|
|
|
Why would you do such a thing to innocent C# code ?
I don't know of one, but it would not surprise me, they are close to being the same language. A C#->J# converter seems like a sure bet tho, give that it would work the same as the C#->VB.NET ones do.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Well I wanted to do a Silverlight version of a C# 2008 Express desktop project, but the Silverlight dev tools 2 Beta won't install on it (yet?), and I thought that a converter could be a quick way of getting an online version of the program without having to learn all of Java from scratch. I've only just got into C# (which I like) and I don't want to have to learn yet another language just to do this.
|
|
|
|
|
IIRC, there was this thing called Grasshopper which translated MSIL into Java bytecode. I don't know if they have a free version, though...
|
|
|
|
|
Convert to Java or to J# ?
it's a little bit hard if you want to convert to Java and If you are using specific .Net classes
I think that you will have to do it manually.
|
|
|
|
|
Hi all,
I'm trying to call a command line app from my c# code and the command line app requires multiple arguments.
This is my code
myProcess.StartInfo.FileName = "convert.exe";
myProcess.StartInfo.Arguments = ("-density 72 Test.pdf Test.jpg");
myProcess.Start();
The problem is it says "Invalid Parameter 72"
when I run this in the command line (cmd.exe) it works fine
convert.exe -density 72 Test.pdf Test.jpg
Is there something I need to be doing with the arguments?
thanks
|
|
|
|
|
Hi !
I think that "Invalid Parameter 72" is a message coming from your convert.exe not from your calling application.
Try with other value?
|
|
|
|
|
Yes but why is it saying it is invalid when it runs perfectly fine when I run the exact same command from the command line (cmd.exe)?
|
|
|
|
|
Strange !
Try to delete "-" from your arguments
|
|
|
|
|
No different withouth the -
still same error
|
|
|
|
|
ouch
sorry
Did your "convert.exe" using external files?
Those files must be in the same directory of your .net assembly
|
|
|
|
|
I've tried having the convert.exe in the same directory as the .net files (in the bin/debug) but same issue still
|
|
|
|
|
Try this configuration
YourProject
|--Bin
|----Debug
|--Convert.exe
|--Files used by convert.exe
|--Directories used by convert.exe
|
|
|
|