|
The Load method loads an image from the path specified in the ImageLocation property, replacing the image that you put in the Image property.
---
single minded; short sighted; long gone;
|
|
|
|
|
OK,
So I seem to be one of those rare people that actually converts *back* from Mac to PC. But, what the heck, ya gotta make a living, right?
Over in Mac-land I used to enjoy using Applescript as a way to write simple programs that could automate a lot of mundane tasks. Wondering if it's possible to do some of the same stuff on my new PC.
Specifically, is it possible to:
1) Automate Explorer (or Firefox) to browse the web and download weather images so they're on my machine when i wake up in the morning?
2) Create back ups of specific local folders and ftp them to my web server?
Any suggestions on where to start - books/web sites/etc.. appreciated.
Thanks!
|
|
|
|
|
@largeinsd wrote: 1) Automate Explorer (or Firefox) to browse the web and download weather images so they're on my machine when i wake up in the morning?
You don't need a browser application to request files from the web. Use the WebClient class and the DownloadFile method to download images.
@largeinsd wrote: 2) Create back ups of specific local folders and ftp them to my web server?
That depends on how you want the backup. If you just want to copy the files, that's easy using the File class.
Use the WebClient class and the UploadFile method to send the files over ftp.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
i have 2 forms, frmtools and frmpad
i have created 10 instances of frmpad and loaded them on mdi's load event
now i want to do the operations only if the CurrentChild is any of the instances of frmpad. if the CurrentChild is frmtools then nothing should happen
for that i have set the tag property of frmpad to "yes" and the tag property of frmtools to "no" and written the following:
if Me.ActiveMDIChild.tag = "yes" then dim a as frmpad = me.ActiveMDIChild
it works also.
but, i don't know the use of tag property. will there be any problems due to the change of tag property or is there any other way to achieve this.
|
|
|
|
|
The tag property is just a place to put any piece of data you want. It's not used by anything in the .NET Framework. Think of it as a little box to put anything you want attached to that instance of the form.
There are other ways of doing it, like seeing if the ActiveMdiChild is of a specific form type:
Dim currentForm As Form
If TypeOf(currentForm) Is frmPad Then
Dim padForm As frmPad = DirectCast(currentForm, frmPad)
... do whatever you need to do to the form ...
End If
|
|
|
|
|
thanks for ur help
now its working fine
|
|
|
|
|
I am working on a project that try to extract image color features. I wonder if vb.net can use to perform the function. If that is possible, can anybody tell me how to do it with any sample code?
|
|
|
|
|
There are articles on here telling you how to do this. Christian Graus has done some very good articles (in C#) on how to access images pixel by pixel and apply filters etc. However this involves using pointers so is not really suitable for VB (take a look though as they are useful and show you the idea behind how you would go about doing what you want - the algorithms and methods at least). Check this thread:
http://www.codeproject.com/script/comments/forums.asp?msg=2216444&forumid=1649&mode=all&userid=2578352#xx2216444xx
There are picture box controls as well but they are not very flexible - check out msdn for info though as they may do what you need.
Take a two step approach here - look at how to access the picture at a low level and then look at what you want to do once you know how to do this.
Dan
|
|
|
|
|
Of course, this all depends on what you mean by "extract image ... feature"??
|
|
|
|
|
Thanks 1st of all, what i mean by 'extract image color feature' is to extract the color information of the specific pixel. For example, the pixel of (20,30) of an 800x600 images which contain RGB value = 123 192 134. Once i specify the pixel, then the corresponding value will be given.
|
|
|
|
|
Have you tried the Bitmap objects GetPixel method??
|
|
|
|
|
I'm making datagrid reports in .aspx pages and I was wondering if there was a way to find out how many pages will print before sending them to the printer?
Any help would be appreciated.
|
|
|
|
|
I'm assuming the document will be printed on the web browser side, so no, there isn't any way for your server-side code to know how many pages the client will use to print.
|
|
|
|
|
That sucks.....
Thanks for your reply though
|
|
|
|
|
How is the server going to know which printers are installed?? What paper size is selected?? What the margins are?? Any other Page Setup settings??
It can't! ASP.NET is a server-side only technology that (greatly simplified!) generates HTML/Javascript for client-side use and rendering only. The server code does not, nor should it ever, care about what the client is doing with, or how the client is rendering, the data sent down the pipe.
|
|
|
|
|
I am new to this but, I was thinking there would be a way in the VB code to find out.
|
|
|
|
|
Then I'd recommend studying how an HTTP server works. The server cannot initiate a connection to, nor can it interrogate, the client-side browser. Doing so would open up a huge range of security issues.
HTTP is simple. The client connects to the web server, makes a request for a page, the web server generates and returns that page, connection closed. Rinse and Repeat... There is no room in there for the client to tell the server anything the server wants to know about the client.
All that VB.NET code executes on the web server only. None of it executes on the browser side. Unless, of course, you start getting into SilverLight[^]. Even then, the code cannot find out anything about the machine the browser is running on...
|
|
|
|
|
Ok that makes sense,
Thanks for the replies
|
|
|
|
|
Hi Guys,
I have a combobox on a form. As soon as I click on the combobox I am unable to get out of it. The combobox shows me all the data it should, but I am unable to exit the control once selected. I can select any value, and do it any number of times however any attempt to close the form, click on another control in the form, etc fails. The only way out is to stop the debugger. No errors are issued.
I've spent an entire day tryin to find the problem and can't. I'd appreciate any ideas please.
The datasource is a very simple dataset (dsCorrespondenceMethods) containing a single table (CorrespondenceMethods). This table contains only 2 columns - an ID column and a description column. The table just contains a list of methods of corresponding such as "Email", "Fax", "Post", etc. I've put it into a table just to make any future changes simple and not require recoding of the app.
Thanks in advance
Mark
|
|
|
|
|
Are you doing any validation anywhere on the form??
I can't replicate the problem, nor can I find any occurances of it.
|
|
|
|
|
Thanks for responding Dave.
No validation yet. I've put together this form and not being experienced it has taken me days so I'm trying not to start again.
The source is a simple DS/table. It saves back to another DS for the client.
IF I remove the "Selected Value" from the combobox (so it has nowhere to save back to) the problem still occurs. This means the only thing on the combo box is the bound items to display the list.
In an attempt to replicate the behaviour and see if it was the dataset, I created a new form and put a combobox and a textbox onto the form. All worked nicely......so I am still lost...
|
|
|
|
|
Since you've been tinkering with this for so long, it sounds like there might be a screw up in the designer generated code. I'd recommend removing that ComboBox and re-adding a new one, setting it's properties to what you need, and see what happens.
|
|
|
|
|
Good to see we are thinking on the same lines. I already tried it after I responded last, and it resolved the problem with one of the combo boxes but not the second one I am having problems with....but at least it is a start.
Many thanks for your help.
MArk
|
|
|
|
|
Hello Friends ,
I am creating mail system in window based application .we are using
richtextbox for writing msgbody and also inserting image in
msgbody .Text is sending but image is not sending plz help
me. Sending button code metion here .
Dim mailmsg As New MailMessage
mailmsg.To = Me.TextBox1.Text
mailmsg.Cc = Me.TextBox2.Text
mailmsg.Subject = Me.TextBox3.Text
mailmsg.From = "Test"
mailmsg.Body = Me.RichTextBox1.Text
Mail.SmtpMail.Send(mailmsg)
Manu
-- modified at 7:38 Tuesday 18th September, 2007
|
|
|
|
|
I haven't tried using this technique, but a little searching of the articles here on CP revealed this little article[^].
|
|
|
|