With WebBrowser1

  • Thread starter Thread starter webmaster
  • Start date Start date
W

webmaster

Hi everyone,

is there a way of initialize a value of file1 with VB.NET ?

<input name= "file1" id="file1"/>

Thank you.
 
webmaster said:
is there a way of initialize a value of file1 with VB.NET ?

<input name= "file1" id="file1"/>

Are you trying to set a default in the html

<input name= "file1" id="file1" value="myValue" />

or actually set it programatically?

<asp:TextBox ID="file1" Columns="36" runat="server" TabIndex="1"
MaxLength="255" CssClass="whatever"></asp:TextBox>

with, in the code-behind,

file1.Text="myValue"

Andrew
 
....or do you actually want to be using HttpWebRequest to perform a POST
request to a web server?

Andrew
 
Thank you for your answer

haber iletisinde þunlarý said:
...or do you actually want to be using HttpWebRequest to perform a POST
request to a web server?

Andrew
 
Hi everyone,

i use SendKeys method to add file in a web page's file object but it's
not working ie8.
Is there any way of do this ?

Thank you.
 
Hey....

Ummm, forgive me for saying so, but good!

SendKeys in a web browser? Are you completely insane? What you are
doing is a massive security risk, may I ask what you are attempting to
achieve by doing this? Apart from attempting to send a file from a users
system without their authorisation.

The web controls are meant to be used by the user, if you don't like
this, you will have to use a client based app. Personally I think what you
are attempting to do should not be allowed.

Nick.
 
It seems that he does not know what he asks

More like thieve files off of peoples systems.
 
webmaster said:
Hi everyone,

i use SendKeys method to add file in a web page's file object but it's
not working ie8.

To achieve what outcome?
To upload a file, eg a web page, to a web site?
To display the contents of a file in an SAAS application (eg. an online word
processor)?
Something else? If so what so?

Is this a descktop application, a web based app (SAAS)?

There might be a better way, but without any clear goals, there can never be
any success...
Can you post the project's specification (or at least the structured
walkthrough of what you are trying to do)?
 
Hey Timothy,

Why would you use SendKeys in a SAAS? I really don't see the call for
it, other than being "sneaky"

Nick.
 
Hey Tim,

You do have some extremely valid points there, but one minor problem,
you seem to have pidgeon holed *all* SaaS applications as dubious, poorly
developed and insecure. I must defend the cause here as the primary
software that I develop is in fact a SaaS. It is both secure and safe to
use for a number of reasons, firstly the service itself acts as a central
auditing system which can be accessed from any pc, it doesn't do anything
untoward and the way it invokes the client based application is from 2
possible avenues, either a token file is sent to the client system, or a
custom URL is fired, both via user initiation. Both methods include a
one-use key which is then passed back to a web service which then acquires
and sends back the necessary information for the client, this is done over
https.

Recent changes to the html controls, namely the "Input" control have
prevented us from being able to obtain the necessary information we need,
but we have got around this via integration of Smart Client technology which
links to the API which supports the SaaS. There are many secure SaaS
solutions around, Unfuddle is also one of them, it's a source code
repository and issue tracking system.

I do understand though, as more often than not a small alteration has to
be integrated now and then in order to get around new security restrictions.
But sometimes those security restrictions seem to be a bit too anal. For
example, the main reason the Input control has messed us up is we would
previously acquire the full path of a document on the users system, this is
all the server would store, the page is served over a secure https
connection and it means that we do not hold any copies of said document on
our servers (which is far more secure than doing so, in any respect). My
gripe regarding this is that the user should have an option, our site is
secure, and how can sending a file across the internet be seen as being more
secure as sending a file path across the internet? Mainly because they
don't care for the users data, only that their software isn't blamed for
anything.

One thing for sure though, as you mentioned, SendKeys? Urgh that's
become stuff of bodging history, but I've never known for it to be used to
mess about with a web page. One suspicion I have is that possibly
"webmaster" is trying to automate some http posting, and rather than doing
it at the protocol level, is doing it via a massive bodge. .NET can
simulate it quite nicely, natively without bodging :)

Nick.

Timothy Casey said:
[SNIP]
[SNIP]

Don't ya just love what happens to links somewhere between here and there.
And a subdirectory named, "<" - I had no idea you could do that!

The links meant to be:
.

http://scripts.web-design-1011.info

.

--
Timothy Casey - Email: (e-mail address removed)
Software: http://software-1011.com; Scientific IQ Test, Web Menus,
Security
http://web-design-1011.com http://speed-reading-comprehension.com
Science & Geology: http://geologist-1011.com; http://geologist-1011.net
 
nak said:
Hey Timothy,

Why would you use SendKeys in a SAAS? I really don't see the call for
it, other than being "sneaky"

'Sneaky' & SaaS in the same Paragraph + Me = Rant!

<RANT>I avoid SaaS because the user can't quarantine the application before
scanning and use. From my perspective, SaaS is itself accomplice to sneaky,
but the corporations don't share my view and have been pursuing this kind of
technology since the heyday of minicomputers; and to the expense of users
and the online economy. They don't understand that those of us doing desktop
apps are going to come at them with safer, faster, cheaper functionality
every time because when application speed runs the additional bottleneck of
server connection speeds, it's like putting the mice in charge of guarding
the cheese or worse still, privatising the maintenance of the power-grid.
That's without allowing for security issues such as not giving your AV
vendor the necessary 48 hours to adapt to the very latest malware before
scanning and running the application. You can't use SaaS securely. Period.
It's absolutely impossible - and even the old Honeywell dual
motherboard/multibase systems with dedicated communication's processor but
without the x86 infrastructure holes and almost hacker-proof, could not keep
a malware author from compromising the outer zone of the system if the
administrator made the fatal error of clearing the use of SaaS. Ultimately,
the quest for SaaS has made drive-by websites not only possible but more
sophisticated; and you can see the source code of the proof here:
http://scripts.web-design-1011.info/</RANT>

I also would have thought that SendKeys would be deprecated - meaning that
all possible applications of the method would have a better alternate route
by now. However, if you are building a web editor for a desktop app using
the web browser control and you wish to restore the cursor/selection
position after performing a string operation to insert some standard tags
not recognised by execCommand or correct execCommand's use of the invalid
'align' attribute when attempting to align a specific block element, there
is no SelectionStart or SelectionLength property to edit.

You have to paste a special character that does not appear in HTML, find the
character to return the selection start, and when you undo the paste, take
note of the length of the InnerHTML before and after to get the
SelectionLength. But wait, it get's even clunkier. After correcting one of
the execCommand's many shortcomings on the fly, the selection/cursor
position is lost and it becomes necessary to use SendKeys with a combination
of {HOME} and copious numbers of {RIGHT} to restore the position the cursor
as it was before you started correcting the original screw-up.

And do you think it works? Maybe! SendKeys sends the keys when it feels like
it, and if you send enough keys using SendWait to prevent inadvertent
typographic mix-ups from REAL keyboard input, the program waits indefinitely
while the operating system looks for something else, anything else to do
first. That's just to show a desktop example of an unfortunately legitimate
use - but if you have a better way for me to restore selection/cursor
position when the MSHTML processor inevitably screws it up, I'm all ears.

As to what the OP was trying to do, it looked like something familiar - but
it could be anything. The OP is simply not telling us enough.
 
Back
Top