|
This[^] article may come in handy.
/ravi
|
|
|
|
|
Thanks Ravi, I'll certainly have a look at it.
|
|
|
|
|
I have been looking into your suggestions at point 1, but I have a suspicion it will not fit for what I'm doing (my knowledge of Web apps is very weak). The website is a non-public site so my application has to login to get the information I need. As far as I'm aware, session data such as authentication information is held in the browser, so the Request/Response model will not work for me. Or do you perhaps know an answer to this?
|
|
|
|
|
Richard MacCutchan wrote: Or do you perhaps know an answer to this?
I always have some kind of an answer.
Here I'd say WebBrowser is a high-level Control you can mimick as much as you want based on the lower-level classes I mentioned. I haven't been dealing with session data yet, however I expect it is quite doable. But then it probably doesn't make much sense if WebBrowser offers it for free and you don't have good reasons not to use it.
Maybe Test Http endpoints with WebDev.WebServer, NUnit and Salient.Web.HttpLib[^] coukd help you a bit, mind you it is a search result, I didn't read it.
|
|
|
|
|
Luc Pattyn wrote: I always have some kind of an answer.
Exactly why I addressed my question to you.
|
|
|
|
|
I took your advice and went for the HTML, and it is considerably easier to parse than the raw text. The data I am using changed again recently and the changes I needed to make to my code were much simpler than if I had stuck with text. Thanks for the tips, I now have a much simpler program to maintain and modify.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Look forward to a Tip/Trick on how you parsed the HTML ... with the understanding that the format of your non-public html source may be so unique that what you had to do to parse it just doesn't generalize out to a wider range of scraping/parsing scenarios
best, Bill
"For no man lives in the external truth among salts and acids, but in the warm, phantasmagoric chamber of his brain, with the painted windows and the storied wall." Robert Louis Stevenson
|
|
|
|
|
Sorry, but there was nothing special about what I did, just used the DOM tree to get to the elements I needed and pulled the information from it. It's not the HTML that is the issue but how the content is presented within each element, and I'm sure that the problems I faced (now I understand it a bit better) were the same as any screen scraper. There is nothing special or secret about my code and I'd happily share it but I think there are already a number of articles that describe the process perfectly well; go to Luc's home page for a good start, also JSOP.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Iam a begineer in windows form.So, please someone help me by giving idea how to design windows form that will run always in fullscreen mode.
I tries to design form ,when i run in fullscreen by clicking fullscreen button then all button and lables etc doesn't expand relatively with windows.
|
|
|
|
|
Have a look at the control's anchor and dock proprties. You may also want to look at one of the layout panels such as FlowLayoutPanel or TableLayoutPanel.
|
|
|
|
|
Try setting the forms FormBorderStyle to None and the WindowState to Maximised
"You get that on the big jobs."
|
|
|
|
|
smokindinesh wrote: when i run in fullscreen by clicking fullscreen button then all button and lables etc doesn't expand relatively with windows.
That is the correct behavior. Getting a bigger screen/higher resolution means that there's more that fits on the screen, not that the computer stretches the old screen to fill it. Yes, the form will look differently on different screens, and you'll have to design with that in mind.
A checkbox should always have the default height. It'll become smaller if the resolution goes up, but you shouldn't "rescale"; otherwise your app will look very funny with it's huge checkboxes
You can lock controls in a position, and have them "grow" to fill the remaining space. That wouldn't work (or look) well with a checkbox, but would do the trick on a multiline textbox. Research "Docking" and "Acnhoring" to have them grow with the form.
Bastard Programmer from Hell
|
|
|
|
|
If you really want a 'zoom' to any size functionality, you might look at WPF rather than WinForms.
Note that it is technically possible to ... when a screen size change occurs ... to calculate a ratio of change, and to recursively visit every control in every container, and alter the sizes and positions of each one ... and even scale-up the fonts, but, believe me, you do not want to go there !
Whether you could actually achieve some "magnification" or "miniaturization" effect by using API calls to change the screen resolution on the fly ... who knows, but I think that, too, would be an uglification (some DirectX games for example, go full-screen).
Get a good grip on 'Anchor and 'Dock, and the roles of 'Padding and 'Margin, as others have suggested here, and I think you can achieve a solution that will satisfy you.
best, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
|
|
|
|
|
Hi All!
The standard OpenFileDialog throws exceptions when I call its ShowDialog method. I have all Exceptions activated (Menu Debug->Exceptions) and also the "Enable unmanaged code debuging" in the project properties -> Debug settings. When I turn off this last option the dialog doesn't throw any exception.
As my project deals with homemade libraries both mnaged and unmanaged I do have to debug the unamanaged code too. So disabling unmanaged debugging isn't a solution.
public AForm()
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
}
Here is what I have for exceptions:
exception: GCError at memory location 0x0019d9d8..
exception: [rethrow] at memory location 0x00000000..
exception: CNLBaseException at memory location 0x065ebcb8..
RPC Server unavailable
Does anyone had this problem before or knows how to get red of those exceptions?
Thanks in advance!
|
|
|
|
|
I think you may have to check some of the initialisation values are set correctly; see here[^] for more details.
[edit]
I have reproduced the code exactly as above and it works fine, so I must assume the actual eception is caused somewhere else, and it just appears to be at that point. Can you explain how you are so sure it is caused by the ShowDialog() method?
[/edit]
modified 5-Oct-11 12:28pm.
|
|
|
|
|
It worked fine some time ago... You're right the exception could be caused somewhere else. I tested to disable only the ShowDialog() method call and it worked fine. No exceptions.
When you ran the code, did you activate the "Unmanaged code debuging"?
|
|
|
|
|
Looks more like your memory has become corrupted. You're not running the method from a different thread, are you?
Bastard Programmer from Hell
|
|
|
|
|
No I'm not, I call it from the main thread.
The Control.InvokeRequired method returns always false .
|
|
|
|
|
There shouldn't be any problems provided your main method is managed, has the [STAThread] attribute, and you create your AForm instance(s) from the main thread. If you deviate from this path, you are set for trouble with COM objects such as OpenFileDialog.
|
|
|
|
|
That's exactly what I did
|
|
|
|
|
<pre>
public MainForm()
{
InitializeComponent();
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog(); //The exceptions are thrown from here
}
</pre>
I have copied the code into my program and it works perfectly.
Perhaps you forget to Initialize some Components that are used by AFORM() and exceptions are thrown because of that, or you forget to initialize the OpenFileDialog itself if it is necesary,
InitialDirectory,Filter...
Try to use your code in different place,
for example in subprogram, and call it from wanted place:
<pre>
public AForm()
{
// calling subprogram
Openfiledialog();
}
void Openfiledialog()
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog(); //The exceptions are thrown from here
}
</pre>
If you dont get error messages again it is clear that something diferent is wrong with your program.
For this exception I have found explenation,
RPC Server unavailable:
You are trying to connect to a remote server that is unavailable or does not exist. This error may be caused by your network connection being lost.
For other exeptions I didnt.
All the Best,
Peric Zeljko
(periczeljkosmederevo@yahoo.com)
-- modified 16-Dec-11 13:59pm.
|
|
|
|
|
Kudos for answering, but please place code inside a pre block either by using the code widget or manually using <pre> ... </pre> around the code. You can still do this by editing your response.
I would not post your email address publicly in an online forum unless you really like spam!
|
|
|
|
|
That was a good clue! I disabled my network adapter to check if the network could cause the problem and the OpenFileDialog worked fine!
As my "My Documents" folder is stored on a remonte server, my computer uses the network connection to get the folder and files informations. Any idea why this could throw the exceptions I have?
I'm not sure yet why I have those exceptions, but my code isn't faulty!
|
|
|
|
|
I am doing a project which requires me to have a link from one page that will direct/take me to another page. How can i do this..?
|
|
|
|
|
Pages generally refer to web development not form development but if you are talking about forms in a Windows Application, it is easy. Create Form1 and place a button on the form using the form designer. Double click on the button and it will create the default event code stub for that control. The stub will be displayed in the code view. In the code stub enter something like:
Form2 form = new Form2();
form.Show();
"You get that on the big jobs."
|
|
|
|