|
For me, the right way is used HttpWebRequest[^], an another way is use WebClient[^]
modified on Tuesday, November 23, 2010 4:30 AM
|
|
|
|
|
memk1 wrote: But, is their another way?
Instantiate a WebBrowser ?
I are Troll
|
|
|
|
|
Doesn't WebBrowser intend to display?
|
|
|
|
|
It's a visual control, but that doesn't mean that you're only allowed to use it when you want to display something. A WebBrowser has the advantage that it'll handle the viewstate, cookies and stuff. It'll cost some extra memory too, but memory is cheap these days
I are Troll
|
|
|
|
|
What are you trying to read. Just saying I want to "read content from the net" is sort of like saying "I like to eat, how can I do that?" We can help, but without a little more information, it will be a bit of a crap-shoot to get a useful answer.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
OK...
I mean, for example, to read article from newspaper site, and to save this text (string? stringbuilder?).
|
|
|
|
|
hi all,
i use a visual sourcesafe (VSS) with visual studio (C#), my problem is the vss keep all versions for a file from when i create it (all versions of file is stored), but i want to keep only last 10 versions of a file, and the old versions i want vss to remove.
because saving all versions of a file need a large size,
how can i do that please
thanks all
|
|
|
|
|
This is not a C# question. Please ask it in the Visual Studio[^] forum.
|
|
|
|
|
Does VSS come with a manual?
I doubt any version control system has that feature. Old versions should be stored as DIFFs, so they don't take up much room. You should break your code into small pieces. You should not commit a change unless you are fairly sure it is correct (and nothing that you know to be bad) -- whatever is in the repository should compile cleanly, etc.
|
|
|
|
|
Hi,
how do I disable "close box" on child forms, but leave it functional for "MDI form". I tried:
private void ChildForm_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
}
it works for child forms, but it also prevents me from closing apllication
(with X button) from main MDI form.
|
|
|
|
|
The code you have shown is correct. What you need to do is: When the user closes your main form, you must notify the child forms that they are allowed to close.
Your code could look something like this;
private bool m_bAllowClose = false;
private AllowClose(bool bAllow)
{
m_bAllowClose = bAllow;
}
private void ChildForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(!m_bAllowClose)
e.Cancel = true;
}
From your main form you would need to call "AllowClose(true);" for all your child forms
|
|
|
|
|
On which event from main MDI form should I call AllowClose()?
If I call it from:
private void MDIMainForm_FormClosed(object sender, FormClosedEventArgs e)
OR
private void MDIMainForm_FormClosing(object sender, FormClosedEventArgs e)
ChildForm_FormClosing() is validated first and it does not close child form.
|
|
|
|
|
Ok,if this is not working for you then you can try using the following code in your childs:
private void ChildForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(e.CloseReason != CloseReason.MdiFormClosing)
e.Cancel = true;
}
|
|
|
|
|
|
Or:
e.Cancel = e.CloseReason != CloseReason.MdiFormClosing;
I do never use an if for just setting a bool value.
|
|
|
|
|
You might also want to look at Disable the Close box on a form[^] which might help with the visible "X" button - I haven;t tried it with MDI children, but it should still work.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I want to design a pop up appication , where i want to display it near a system tray, how to get the height and width of the screen so that i have to exactly display in the same location and it should be adjustable to all monitors resolutions(i mean multiple systems).
|
|
|
|
|
You REALLY need to learn to use the research tools, this problem has been solved [^]many time before.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank.. i solved it and how to set a .bmp skin of forms and perform actions (what iam saying here is i want to add skin for a windows form), please let me know... thanks in advance..
|
|
|
|
|
|
hello, I am able to get all the colors of an image in RGB format is there anway i can do it to get the main colors of the image?
for example:
http://i55.tinypic.com/2mq0vgk.jpg[^]
Main colors detected will be green and red
needing help!
|
|
|
|
|
So, if you are able to get all the colors of the image, you could easily sum up their occurence. The one color with the highest sum is then your main color. You might also want to threshold the colors a bit so that you evaluate {255,0,0} and e.g. {255,15,15} as being Red and {0,255,0} as well as e.g. {47,255,47} as being green.
|
|
|
|
|
i tried averaging the colors however it only gave me the color red but not red and green in the example of the image given above.
THe range for RGB is very wide meaning i have to use if statements?
how to you sum up occurence?
modified on Tuesday, November 23, 2010 1:34 AM
|
|
|
|
|
While JF2015 suggest to predefine colors and their RGB ranges, I think the main color(s) could be anywhere in the RGB range - hence predefined ranges do not help.
Beyond counting the occurrences of every color, I would add a weighted amount for pixels whose color is "similar" to the color in question.
My suggestion for getting the main colors is hence a very slow one - you will need a specialist for fast algorithms to get it optimized!
- define how far the second (third etc.) color must be away from the main color
- create an array of doubles for all RGB values (oh yes, some 16 million)....
- iterate through all the pixels of the image:
- - add 1.0 at the array position of the pixel's color
- - for the array positions of "similar" colors, add the weighted amount, e.g. 1.0/(1.0+delta R)/(1.0+delta G)/(1.0+delta B) (ehm, that's another nested loop(s)...)
- now iterate through your array of RGB values, and select the highest value (you may sort the array): this is the main color.
- take the RGB value with the next highest value
- - if it is "close" to the main color, repeat the step above
- - otherwise, it is the second color.
- with third (forth etc) color, do as outlined for the second color, but do not forget that it must be sufficiently away from all previously selected colors.
When you test this "naive" algorithm with your example image, bear in mind that it is not at all optimized, and surely terribly slow! Better test with a very small image first.
|
|
|
|
|
hi all
please can someone tell me how to hack the password of yahoo ID?
|
|
|
|