|
Yes they do... I'm working in vs05. this is just weird.
Everything else I assign a value to works, except BackColor.
|
|
|
|
|
I just tried it in VS2005 with no trouble, so there must be something in your code.
At which point do you set the BackColor?
|
|
|
|
|
Hi...
The "UseVisualStyleBackColor" property we set to "True", set to "False" this works.
Thank you for the reply.
|
|
|
|
|
hi,
I used below code for get mht file from given URL.
But sometimes it dosn't work and wait.
CDO.Message msg = new CDO.MessageClass();
ADODB.Stream stm = null;
byte[] data;
msg.MimeFormatted = true;
msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", "");
string path = destinationPath + "\\" + fileName;
stm = msg.GetStream();
stm.SaveToFile(path, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
msg = null;
stm.Close();
when I debugged the code I saw this error in:
msg
--[CDO.MessageClass]
---- all items has error
"Cannot evaluate expression because a native frame is on top of the call stack"
it was stuck at this line :
msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", "");
are there any way to get if isTimeout or not?
thanx...
I want to fly but I don't have wings
modified on Saturday, July 26, 2008 11:18 AM
|
|
|
|
|
If you stop the code in the middle of unmanaged code, the debugger can't reach the items on the stack that is created by the managed objects because it doesn't know the size of the unmanaged stack frame. You have to step through the unmanaged code back into the managed code before the debugger can show you the contents of the stack.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Yes, you are right.
I got it.
I need timeout option, but there is no timeout property or parameter etc...
I tested again the code if it will stuck or won't.
It is still same but after 4-5 minutes it was aborted and it worked.
4-5 minutes is too long for me.
I will work with thousands url, I can't wait 5 minutes for each url.
How can it continue after 15 seconds?
Is it possible?
I want to fly but I don't have wings
|
|
|
|
|
guys,
i need help how to approach/any idea to generate a list of names in a random. what i mean is i have an excel file which has list of employee names then when i click a button. it will give a random group. for example. 50 names in 1 group. it will give a result in a text file.
thanks in advance. i really appreciate your help.
C# Coudou
Microsoft End User
2000-2008
******************************
The best things in life are free
******************************
|
|
|
|
|
What I have done for that sort of thing is to have another table with two columns; one for the IDs of records in the main table and populate the other column with random numbers.
When it's time to select records; clear out the table, populate the table, then query the table, sorting by the random number column, and use the first 50 (or whatever) IDs.
You could simply add a random number column to the main table, but my process was trickier than that.
|
|
|
|
|
hope this helps!
First, read all the names from the excel file, probably into an array.
then, use some randomizing technique, and maybe a loop, to select your group.
and lastly, while selecting, write the names to a text file.
He who goes for revenge must first dig two graves.
|
|
|
|
|
Creamboy wrote: then, use some randomizing technique
Riiight... isn't that the part he's asking about? 
|
|
|
|
|
Put the available names in an array, then this method will pick the specified number of strings from it:
private string[] PickFrom(string[] values, int count) {
Random r = new Random();
string[] result = new string[count];
for (int i = 0, index = 0; index < count; i++) {
if (r.Next(values.Length - i) < count - index) {
result[index++] = values[i];
}
}
return result;
}
Usage:
string[] group = PickFrom(listOfNames, 50);
Note: The names in the returned array will be in the same order relative to each other as in the original array. If the original array is sorted, the resulting array will also be.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa,
I like that approach very much.
I was puzzled though by the details of the conditional test.
Shouldn't all candidate values get the same probability?
IMO the test should read if ( r.Next(values.Length) < count )
so each value[i] has probability count/value.Length
[ADDED] I see now. With fair probabilities, the algo may fail altogether,
when r decides to return lots of large numbers. So you are cheating a bit
to make it work all the time, at the expense of the first elements in the array,
since your probabilities are increasing at first.
Very clever. A little explanation was in order though.
[/ADDED]
|
|
|
|
|
Luc Pattyn wrote: Shouldn't all candidate values get the same probability?
IMO the test should read if ( r.Next(values.Length) < count )
so each value[i] has probability count/value.Length
All the candidates get the same probability. The probability for each candidate depends on how many of the previous candidates were picked. For example, if you reach the last candidate (with still one to pick), the probability for that one will be 100%.
Luc Pattyn wrote: So you are cheating a bit
to make it work all the time, at the expense of the first elements in the array,
since your probabilities are increasing at first.
Not at all. There is no cheating at all, the randomness is completely accurate.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sorry, my mistake. I did a little example earlier (5 out of 10), but went wrong early on, so it looked
as if probabilities were increasing with i. But they are not, everything was fine when I tried it once
more. This is a fantastic little algorithm, and I hadn't seen it before. Thanks.
|
|
|
|
|
That's one to remember. And I suppose an Excel macro could be written to implement it.
|
|
|
|
|
Hello Friends,
I want to know how can we share desktop. I know this is very hard to do all the things,
but here i am asking for any demo example from which i can learn more.
Thanks in Advance.
Best Regards,
Chetan Patel
|
|
|
|
|
|
I am looking for a collection that is typesafe and will allow me to add two items.
eg:
NewCollection<Type, Color>> collection = new NewCollection<Type, Color>>();
collection.Add(theType, theColor);
I've had a look on MSDN, and the only collections that accept two values are key, value (i.e: hashtables). The problem with this is i want to be able to get the values by index.
eg:
Type typeReturned = collection.ValueType[32];
Color colorReturned = collection.ValueColor[32];
OrderedDictionary would be fine if it was typesafe. So does anyone know of a collection that matchs my needs?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hi Gareth,
I did not know OrderedDictionary.
the one you want maybe is called SortedList.
In this world a Dictionary is not sorted at all, and a SortedList looks like a real dictionary!
Some collections have a static Synchronized method, for the ones that don't you can provide it
easily yourself.
|
|
|
|
|
|
Can't you create a wrapper class that stores the two items? A simple (built-in) method would be something like:
var collection = new List<KeyValuePair<Type, Color>>();
collection.Add(new KeyValuePair<Type, Color>(theType, theColor));
Type typeReturned = collection[32].Key;
Color colorReturned = collection[32].Value; If you created your own wrapper class then you'll be able to add as menu "sub-items" as you want and give them proper names, but I've used the KeyValuePair in the past when I've wanted something quick and dirty.
|
|
|
|
|
Ed.Poore,
Cheers, i did not think of that.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hi,
I have developed a web-service.It has some dll's written in windows apps using c#.net. My webservice is working fine on my local system.(I gave webservice IP as "http://mysystemIP/../xxxxx.asmx".)using another windows apps I added web refrence and working fine in my local system
Now I want make my webservice work on another system and to access all the webmethods.
1.If the systems are in LAN,how to do that work?
2.If systems are in WAN,how to do tthat work?
kindly guide me...
|
|
|
|
|
[edit]Don't know why a blank message appeared[/edit]
- Should be alright provided that there are no security restrictions in place between you and the server.
- Provided your host can host it and your client can access the host there will (hopefully) be no problems.
Last modified: after originally posted -- Don't know what happened there
|
|
|
|
|
Hi all,
How can i split a byte array...
I have a byte array whith some data and i want to split that byte array from specified location with specified length.....
something like
byte[] newbyte = bytedata.split(startIndex,Length);
Thanks in advance
Vayanan
|
|
|
|