If you can get a reference to the Element which represents the image then I think you might be able to get it by using a method named something like GetAttributeValue (sorry I can't remember it exactly of the top of my head), if you call this with "width" and "height" as parameters I think you can get the height and width of the image (not the original image size but the size of the displayed image on the page).
You are correct: use the HtmlElement class and GetAttribute() method to get the image size with width & height as parameters. However I was referring to the "file" size (in bytes) of the image file. I know IE stores the webpage files in "Temporary Internet Files" folder as local cache but somehow programmatically it (OS?) does not allow the files to be read. However you can manually see these files using Windows Explorer.
Thanks. You are correct. My dilemma is I'm using WebBrowser control first to navigate to the webpage to get all the images names via HtmlDocument/HtmlElement classes. If I use WebRequest/WebResponse, I'm essentially doing two requests from the server. I'm thinking if there a way to just do these things once. I don't have to use WebBrowser control but it helps in easily parsing the desired attributes.
Appreciate your help. Things are looking up!
BTW: I tried accessing a local image and I got a "401" not authorized error message.
Unless you already know the uri of the image/file you want to get the size of you cannot make it in one request because you have to have one to find the location of the file (i.e. a request to the html file to find the image path) and then a request to the image file for the file size.
I agree. Another way I thought I could do was to read the image file info from the Temporary Internet Files folder but I can't use the FileInfo class since XP does not seem to allow any file in that directory be read except desktop.ini. If I can circumvent this that would resolve the issue.
Not really, apart from that my view of accessing the Temporary Internet Files is a bad idea on the whole. There are too many ifs and buts.
The thing which I should be improved is trying to eliminate the WebBrowser if you're simply using it for accessing the html to get the filename and not actually displaying it because my guess it'll be very resource hungry.
If you know that the image paths will be specified in the html page then it'd probably be more efficient to make a WebRequest or use WebClient to "download" or read the file and then use a simple parser or regular expressions to extract the image file, this way you're not creating a UI control and then not displaying it.
Hey guys, I have to tables and I want to make a selection from both tables
Table 1: Customer >> Name and number (my main table)
Table 2: Order >> Order
with the select command i select them, not I want to show it in DataGridView, but i can fill data gried with one table DataGridView1.dataSource = MyDS.Tables["Customer"];
but when I fill in the DataGridView, It authomatically adds the new Row from Order Table(i want to change the header but its not possible because it brings it driectly from database).
I used this command to add a column in my dataSet MyDS.Tables["Customer"].Columns.Add("Order");
what I dunno how to do this, to show the data in the column Order from Order table in my new Column that I have created.
You're being a little vague, so hopefully I'll be able to get some clarification. Are you trying to join two tables and then display the resulting join in a DGV? If so, can you give us the query string that you use to retrieve the data. Also, have you stepped through your code and ensured the query returns what you want?
I was wondering if it would be possible to implement a LinkHover event on the rich text box control. It already has a LinkClick event, but no facilities to offer a tooltip on LinkHover. I'm assuming it is possible, as on mouseover a link the cursor changes, but i'm guessing it will need some COM work.
Why don't you try deriving from the RichTextBox and overriding the OnMouseMove method. You can then use RichTextBox.GetCharIndexFromPosition to get the character under the cursor and if it's a link then fire your custom LinkHover event (of course that's a simplified plan but it should get you started).
The only trouble I see at the moment is finding out the indexes of the links. I can't seem to find anything which lists them which suggests they are handled internally by the control.
So if you can solve the last problem then you're away (also this solution is managed rather than COM Interop)
Well, if you want to minimize a form created in your program, this is a pretty easy task:
1. Just add a method to the Click event of the button. (Designer can even do that for you)
2. In this method you set the WindowState Property to Minimized: this.WindowState = FormWindowState.Minimized;
To open a new form just add MyForm.Show(); to your method for the click event.
i have create a program that show my a table in my DB.
until here all is good ... but i want it to be able to update the table
without me having to write the Rows or the column so the program can work
with any table even if i dont know everything about the table.