|
Christian Graus wrote: Type whatever name you like into the properties window, or write an add-in ( and a CP article )
Yeah, I'm lazy, what can I say?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
i find this framework in
http://www.codeproject.com/cs/design/razorpt1.asp
http://www.codeproject.com/cs/design/razorpt2.asp
it's good framework,but it's documents and examples sources code less.
simple is better
|
|
|
|
|
I have a question about SqlDependency.
When using the SqlDependency class to get a notification of a change to a table, what is the best way to actually find out what data has changed? Is this even possible?
We are working on a stock trading system in which stocks are valued based upon notifications in the changes of the price, quantity, etc. Any light that you could shed would be helpful! Thanks a ton!
Ryan Heaney
rheaney@sgfallc.com
|
|
|
|
|
Hello,
Have a question. Trying to compare 2 arrays and adding the difference in a 3rd.
Array1 has {hello,bye,goodluck,bonjour} and Array2{hello,bye,bonjour}, and the
third should then get {goodluck}
Now, I found a way, but.. it's just plain cheap in my opinion and I'm sure there's a better, faster way of doing this. Here's what I got.
int count=0;
string[] array1 = new string[5];
string[] array2 = new string[3];
ArrayList array3 = new Arraylist(array1.length - array2.length);
for (int x = 1; x < array1.Length; x++){
listLocal.Items.Add(array1[x].ToString());
for(int y = 1; y < array2.Length;y++){
if (!local[x].Contains(array2[y].ToString()))
count++;
if(count==array2.Length-1)
array3.Add(array1[x].ToString());
}
count = 0;
}
Of course the way the code is now, it means that array1 while always
be larger then array2, so when array2 is larger I have to place another if statement.
So please, what's the better way? Show me the light and release me from these infernal
"IF"s and "FOR"s ..
Thank you,
Loneferret
_____________________________________________________________________
Cross my heart, smack me dead...stick a lobster on my head.
|
|
|
|
|
If you can sort the arrays first, that will help a lot, then you can use a binary search to find items, and just step through items in both that are alike until you find one that isn't.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the advise. I'll look up binary search and see how it's done.
About the sorting, the arrays are allready sorted, forgot to insert that part.
Array.sort(arrayname);
If I strike out with the binary search, I'll cry for help again.
Thanks...
LoneFerret
-- modified at 7:36 Friday 18th August, 2006
Cool, thank you for the advice... It works like a charm and a lot faster too...
Thanks a lot
LoneFerret
Cross my heart, smack me dead...stick a lobster on my head.
|
|
|
|
|
Hi ,
I'm creating a custom control for a web project. I wanted to add flash content as part of that control. How do i do that in C# file. Pls help.
Thanks in advance,
Priya
|
|
|
|
|
There are two controls that are able to display Flash content_
- Internet Explorer control
- Macromedia Shockwave control
Add one of them to your tools list, drag it onto the form. Set the filename (or "Navigate" to the file in IE control) at runtime.
____________________________________
There is no proof for this sentence.
|
|
|
|
|
Dear gurus,
how can I store size and position (and may be more) of a form in any config-file if I close my application ( with C# and .net framework )
Can somebody help me here?
Some papers or articles?
Kind regards
|
|
|
|
|
Save an XML file into the user directory of the application. Do not use the app.config file as it is not meant to be written to.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I have a checkbox and a combo box that is enabled/disabled using a button(to put into edit mode)
The thing is, I want the user to be able to read the text/check that is in the field, but not edit it.
With a text box, I can just change the backcolor to white and when .enabled is set to false, it only grays out the text but is still legible.
Any ideas?
Thanks
modified on Wednesday, May 21, 2008 4:08 PM
|
|
|
|
|
Hello
ComboBoxes also has a BackColor property which you can change at runtime.
So, where is your problem??
Regards
|
|
|
|
|
The backcolor propery for the combo box does not affect the background when enabled = false. The inside of the combo box greys out along with the text and is almost impossible to read. Same thing for a checkbox.
|
|
|
|
|
Nevermind about this.
I just used the AutoCheck property to restrict the Checkboxes, and I overlayed the ComboBoxes with a TextBoxes and toggle the visible property with the edit mode. Works well enough for me and makes everything legible.
MS should seriously consider adding a read-only property to combo boxes on the next .net update. I also hope they implement ILMerge into visual studio.
Michael
|
|
|
|
|
Hello
Glad that you made it
Regards
|
|
|
|
|
I am using this Code for reading Image from URL
private Image getImage(string url)<br />
{<br />
Image im = null;<br />
try<br />
{ <br />
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);<br />
request.Method = "GET";<br />
request.Timeout = 15000;<br />
request.ProtocolVersion = HttpVersion.Version11;<br />
<br />
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())<br />
{<br />
using (Stream responseStream = response.GetResponseStream())<br />
{ <br />
im = Image.FromStream(responseStream);<br />
}<br />
}<br />
}<br />
catch (Exception ex) <br />
{<br />
Debug.WriteLine("Exception in getThumbnail. Url: " + url + ". Info: " + ex.Message + Environment.NewLine + "Stack: " + ex.StackTrace);<br />
}<br />
return im;<br />
}
but if the URL like this
http://mud.mm-a5.yimg.com/image/1942583882[^]
the code will not work correctly.
How I can Fixed it ?
|
|
|
|
|
help me plyz
this message display after click the Button
Exception System.Net.WebException was thrown in debuggee:
The server committed a protocol violation. Section=ResponseStatusLine
|
|
|
|
|
Hi all
can someone pls tell me why multiple class inheritance is not supported in C#.net?
thanks
|
|
|
|
|
From WikiPedia[^]:
Multiple inheritance can cause some confusing situations (I believe they're referring to the diamond problem - see this[^] link. -- Ravi), so there is some debate over whether or not its benefits outweigh its risks.
Java compromises: it allows a class to inherit interfaces from more than one parent (that is, one can specify that a class inherits all the types from its parents and must have all of the same externally exposed methods of its interface-parents, and allow the compiler to enforce that), but can inherit implementation (methods and fields) from only one parent.
Microsoft's .NET languages such as C# and Visual Basic implement this interface approach as well. In contrast C++ implements full multiple inheritance.
/ravi
|
|
|
|
|
|
I asked a C# instructor several years ago this question. He said it was because the designers were worried the dumb people wouldn't understand multiple inheritance. (He added that most the dumb things in C# were done for this reason.)
This response is flippant, but I suspect more true than not. Multiple inheritance is very powerful and rarely used in good code, but when needed, it's really needed.
The solution was interfaces. Personally, I'd rather have had multiple inheritance, but what can you do? (I also think they should have had a scoped destructor mechanism built in. I'm sure everyone has their list of complaints.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I've read the license agreement for my webservice and specifically note the clause "one call per second per IP address", my question is about "masking" IP addresses. Is it possible to route my webservice calls through a proxy server in combination with multiple worker threads thereby possibly making more than 1 request per second? I've seen this technology before concerning web surfing. There are free proxy servers willing to route your packet traffic, I'm just not sure how to implement something like that. Basically give each thread its own proxy server that can route 1 call per second with the end result being 10 threads means 10 calls per second approxiamately.
|
|
|
|
|
That would be like cheating ... not?
- Jake
|
|
|
|
|
Why yes it would be, but thats the beauty of it. Any hints?
|
|
|
|
|
Hint to do something bordering on illegal? Something that can get you sued? I don't think so...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|