|
Stop crossposting the ads, please.
I are troll
|
|
|
|
|
Hi all,
I've added value pair, int and string, in a Dictionary. Now I want to take pairs from the last. int value represent the index of a string and string value represent the value to insert into the original string.
I've try this.
<br />
foreach (KeyValuePair<int,> pair in diction)<br />
{<br />
str = str.Insert(pair.Key, pair.Value);
}
This insert items in wrong index once the first item index is added in the correct place. So I want to added them from the last item. But I'm messup with that how to access the last element. Can someone help me to do this.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Dictionary<TKey, TValue>.Last Method
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Thanks for the replay.
Can you explain it bit more with my example, please?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Dictionary<int, string> diction = new Dictionary<int, string>();<br />
<br />
diction.Add(1, "first");<br />
diction.Add(2, "second");<br />
diction.Add(3, "last");<br />
<br />
Dictionary<int,string>.KeyCollection keys = diction.Keys;<br />
int lastKey = keys.Last();<br />
<br />
Dictionary<int,string>.ValueCollection values = diction.Values;<br />
string lastValue = values.Last(); <br />
<br />
MessageBox.Show("lastKey = " +lastKey + " lastValue = " + lastValue);
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
But now I've a little mess here. I want to iterate whole dictionary, from the last to first pair. In this way, I've to take the last value and to find the next need to remove it, right?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
string allstr = "";
for (int count = diction.Count; count > 0; count--)
{
allstr += diction.ElementAt(count-1).Value;
}
MessageBox.Show("allstr = " + allstr);
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
I got this error message.
'System.Collections.Generic.Dictionary<int,string>' does not contain a definition for 'ElementAt'
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: I got this error message.
'System.Collections.Generic.Dictionary<int,string>' does not contain a definition for 'ElementAt'
Add
using System.Linq;
will do.
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
or just use
diction.Last().Key
and
diction.Last().Value
will do.
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Hi,
I am using rich text box to display data from database but i want to display data from from a an other world which is on the middle or some where in database like i have data,
Please remember to search our articles, the forums, MSDN and Google before posting your question.
Now i want to start the first letter in rich text box like MSDN not from Please
Kindly tell me what i should do please do replay.
Thanx.
|
|
|
|
|
I don't really understand the question, you would like to get some random words which will be placed inside your rich textbox?
I'd do that something like this:
String s = "Please remember to search our articles, the forums, MSDN and Google before posting your question.";
String[] words = s.split(' ');
String endString = String.Format("{0} not from {2}", random.Next(words.length),random.Next(words.length));
If this isn't what you want, then you should recapulate your question.
|
|
|
|
|
Dear,
Thanks for your replay but it is not what i am saying i am just saying that if i have some data like A to Z but when data fill in rich text box the starting letter must be
F in database of A to Z not started from word A.
I think you will understand my question now.
waiting for your replay.
|
|
|
|
|
I really don't get your question.
What is the text in the database? And what is the expected output?
Like you have this in the database: 'a b c d e f g h' and the output is 'f g h' or something.
And where do you have the problem? Splitting the data to whichever you want or getting data out of the database?
|
|
|
|
|
|
|
Hi, I want to change the url displaying on browser when a file is opened through it. For example,
file:///s3413.pdf/ to http://NewWebapplication.pdf
how it is possible using c#?
|
|
|
|
|
Write a new browser in C# and make it to do something horribly anti-standards as you just described.
Otherwise, it's not gonna happen. It should not happen. Do not so much as think that what you are asking is reasonable.
Now, if you just want to talk about redirection from an actual web site, not your local file system, there are things that can be done. But those don't involve C# either.
Don't let my name fool you. That's my job.
|
|
|
|
|
Well...It can be done...It is known as URL Rewriting Take a look into this URL ReWrite[^]
Or try Google for more articles.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
I know what URL rewriting is.
What you missed is that the OP is trying to rewrite when he is looking at the file system, NOT a web server.
Since there is no web server involved, there is no URL rewriting possible unless you write your own browser and then distribute that browser to all your customers.
And that's a really stupid thing to do.
Don't let my name fool you. That's my job.
|
|
|
|
|
Oops!! I got it ...I missed out the file system...Thanks for enlightening me
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Had it been a web served document, your answer was rather good.
Don't let my name fool you. That's my job.
|
|
|
|
|
Hi friends...
Please help....
I have created a setup in VB.NET and installing in different machines. Now the problem is that the same setup is working on some machine fine, while same setup is not working. When i am trying to run the application its giving a message that "unable to find a version of the run time to run this application".
And also i want to tell you that all those machine having same configuration and same operating system, same anti virus.
Now please help me... i got frustrated with this kind of error.
krishna veer singh
|
|
|
|
|
install .Net Framework in those pc plus this[^] is VB forum...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
What Version of Visual Studio did you create your Application ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|