|
I have never done that before but I have a few ideas that may help
Each website has different "fields" in their forms but generally they have an "id" and some variable that stores the link to the address where the contents in that field may be processed.
You need to always make sure each supported website is maintained so that the app always knows what each sites "schema" is...
You will then need to figure out what platforms your app will check, firefox, Ie ... as you will need to write a plug-in to interact with form elements, probably different for each environment (c# may not be 100% any more).
Overall its simply getting your browser to recognise the web page, grabbing the stored details from the user, decrypting the credentials and sending it via a browser plugin to the form elements based on the unique schema.
...Just some ideas...
|
|
|
|
|
Thanks for ur suggestion what i was thinking was to search for fields like id/username and the password fields is pretty common so if i could search these in the webpage and then fill the corresponding fields but how to fill the fields ????????
|
|
|
|
|
Doing a search like that wouldn't be reliable, and looking at the GMail login code it wont work...
I am afraid you will have to maintain each sites schema, luckily for you they don't change often.
Filling in the form with the user text requires (I would assume) an interface between your repository of user data (c# app stuff) and the web page.
As mentioned briefly before you will most likely need to write this "intermediate" app in a language that your desired browser needs. There may even be library's in C# from the browser dev team for public use, definitely in fire-fox anyway...
If the intermediate app can read local data, you could decrypt the user data required locally and get the app to read it before finally deleting it as a method of passing variables from the c# app to the plug-in?
You will have to delve deeper to make this, C# alone will probably not be the only tool to achieve this!
Hope it helps.
|
|
|
|
|
venomation wrote: I am afraid you will have to maintain each sites schema, luckily for you they
don't change often.
Actually, they change as soon as you've come to rely on the automated login filler and have forgotten the password.
|
|
|
|
|
There are a couple of ways of doing this, the easiest/most reliable I've found is to recreate the submission form with the same target and fill the fields there, and then autosubmit the form. This can be totally invisible to the user I've never done this using .NET but it can be done with static HTML and some basic javascript so doing it with .NET should be a doddle.
I have come across a couple of secure sites that wouldn't play ball with this but they're rare.
|
|
|
|
|
can u help me out with the java scripts for it????
|
|
|
|
|
This is a very simple example...
Notice there is only one inline javascript function that submits the form, the rest is plain html.
<html>
<head>
</head>
<body>
<!--
<form name="elementNameForm" action="targetPage.html" method="post">
<input type="hidden" name="elementNameUserName" value="userName" />
<input type="hidden" name="elementNamePassword" value="password" />
<!--
<input type="hidden" name="elementNameSubmitButton" value="submitText" />
</form>
<script language="javascript" type="text/javascript">
<!--
document.forms[0].submit();
</script>
</body>
</html>
|
|
|
|
|
I have a panel (win forms) that has scroll bars, the problem is that when the scroll button on the mouse is scrolled it is meant to just execute x, instead it is executing x and scrolling vertically!
How do I disable mouse scrolling only for the scroll panel and still capture the mouse scroll?
If I have confused you:
I would like the following:
1:Execute x command when mouse is scrolled
What it is doing (the problem):
1:Execute x command when mouse is scrolled
2:Scrolling vertically (DO NOT WANT)
Thanks
|
|
|
|
|
This works to disable mousewheel scroll for a listbox, so I'm guessing it may work for a panel as well.
listBox1.MouseWheel += new MouseEventHandler(listBox1_MouseWheel);
...
void listBox1_MouseWheel(object sender, MouseEventArgs e)
{
(e as HandledMouseEventArgs).Handled = true;
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks, I tried it but it did help
Still scrolls + executes instead of just execute.
MapRender.MouseWheel += MapRender_MouseWheel;
...
void MapRender_MouseWheel(object sender, MouseEventArgs e)
{
if (e.Delta > 0)
_presenter.IncreaseTileSize();
else _presenter.DecreaseTileSize();
(e as HandledMouseEventArgs).Handled = true;
}
|
|
|
|
|
To avoid confusing the user, you should not do that... The best thing to do would be to uses a modifier key (like Shift + Mouse wheel) for your action.
Anyway, you would need to mark the event as handled to avoid default execution. For that, you probably have to handle to WM_MOUSEWHEEL message... or uses something else than a scrollable panel.
One possibility would be have have a regular panel and scrollbar controls and handle yourself the scrollbar.
Another possibility might be to have a control that handle the mouse wheel inside the panel and require the user to be over that control for you special function. It could then works similary to nested panel inside Internet Explorer... The inner most one would handle the event.
Philippe Mori
|
|
|
|
|
Thanks for the reply, I have already tried handling WM_MOUSEWHEEL messages but does not work...
Philippe Mori wrote: The best thing to do would be to uses a modifier key (like Shift + Mouse wheel) for your action.
This scenario seems like it would also fit the same problem im currently facing?
I would still have to sent the MouseWheel event and then check...
Such as:
MapRender.MouseWheel += MapRender_MouseWheel;
MapRender.KeyDown += MapRender_KeyDown;
MapRender.KeyUp += MapRender_KeyUp;
...
void MapRender_KeyUp(object sender, KeyEventArgs e)
{
if(_current == e.KeyCode)
{
_current = Keys.None;
}
}
private Keys _current = Keys.None;
void MapRender_KeyDown(object sender, KeyEventArgs e)
{
_current = e.KeyCode;
}
void MapRender_MouseWheel(object sender, MouseEventArgs e)
{
if(_current != Keys.ControlKey) return;
if (e.Delta > 0)
_presenter.IncreaseTileSize();
else _presenter.DecreaseTileSize();
}
Still have to pass through the same event handler which calls the scroll bar to change...?
|
|
|
|
|
You don't really have to hook keyboard events as it it possible to check the current keyboard state at the time MouseWheel is called.
But effectively, you still have to prevent the event...
Maybe one possibility would be to derive a control from the panel and override OnMouseWheel method.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onmousewheel.aspx
Otherwise, the trick to uses a non scrollable panel and manual scrollbar controls would works...
Also, you have to be carefull about which control has the focus... Typically the inner control (the one inside the scrollable panel) should be focusable and handle the mouse wheel.
Philippe Mori
|
|
|
|
|
Thanks for your help Gave me a dirty idea...
I have solved my problem in the form of (what I call) a hack
The main form receives and handles the "MouseScroll" so the map render panel does not need to.
Now for the hack part:
void MapRender_MouseEnter(object sender, EventArgs e)
{
this.ActiveControl = null;
}
When the map is entered instead of it becoming the focused form (thus any scroll will screw up the vertical scroll), nothing is - yet the scroll behaviour still works!
Thanks for your help, I know my solution sucks but the map render is too tightly coupled for me to apply any radical changes to the control
|
|
|
|
|
I think you should keep in mind what one of the other posters said, Users expect the default behavior of a mouse wheel to handle a scroll in any application they use. Taking that away to make the worldwide default behavior do something different is annoying and can put users off especially if you do more things of that nature.
Users as a rule do NOT like to relearn how things work.
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
Good advice and I would generally follow such advice however I am quite familiar with accessibility, the app is just a small tool for me and a friend
We needed a quick way to change the selection size fast, the mouse scroll felt like the best candidate for such operation.
Otherwise key presses or other controls will be used for the same affect, but surely wont be as seamless?
|
|
|
|
|
hello guys... I want to learn the basics of WCF apps. Just to host a small service in localhost (IIS) and then want to consume that service in client. I am still unable to find the right tutorial. Any help? thnx
|
|
|
|
|
Some reading here[^] should help you out.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Why do I feel that beginners are Slaughtered at msdn?
|
|
|
|
|
Try the second and third links here[^].
Always: Google first
CodeProject next
MSDN - when all else fails.
The best things in life are not things.
|
|
|
|
|
That's because MSDN is reference material, and not learning material
Very good for finding out the specifics of a function; not so good for learning about the function.
|
|
|
|
|
See this[^] introductory article.
/ravi
|
|
|
|
|
I'm using StrCmpLogicalW to logically compare strings. My signature is:
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
public static extern int StrCmpLogicalW(string x, string y);
seems like its kind of working, but I see that its giving me random results when trying to sort doubles (as strings).
1 ===> 0.883266340175621 <-> 0.842264196854649
that seems like its right, but then a second later I get:
1 ===> 0.842264196854649 <-> 0.91145355364217
that seems wrong. Obviously 0.91 is greater then 0.84. I'm thinking StrCmpLogicalW isn't liking that the 2nd string is shorter.
Can't really special case this since its in generic code that uses LINQ expression trees to get property "x" from objects and then does .ToString() on them for passing into StrCmpLogicalW.
Any ideas?
-- Modified Friday, June 3, 2011 5:05 PM
|
|
|
|
|
Seems like the second comparison is failing because the string is shorter... thats a stupid bug in StrCmpLogicalW :p.
|
|
|
|
|
I agree, as a number obiously we would expect .91 to be larger than .84. but as a string the shorter one is smaller.
That being said I'm not sure the best way for you to fix it
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|