|
I actually had to copy the programmers designer code of the form and use it to make it work... weird...
|
|
|
|
|
Can any one Help,
I am trying to do following step dynamically using UIAutomation
in c# 3.0
1)Open Outlook
2)Open Inbox
3)Select first unread email.
4)Open the first unread email.
5)If there are attachements, download the attachements.
Select next unread email and do the same as above.
I have tried below code.I Can open the outlook Express.But I can't read mail.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Windows.Automation;
using System.Diagnostics;
namespace ConsoleApplicationUI
{
public class ReadMail
{
static void Main(string[] args)
{
ProcessStartInfo psInfo = new ProcessStartInfo(@"C:\Program Files\Outlook Express\msimn.exe");
Process prov = Process.Start(psInfo);
Thread.Sleep(5000);
AutomationElement Inboxstart = null;
PropertyCondition Inboxconds = new PropertyCondition(AutomationElement.NameProperty, "Inbox");
Inboxstart = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, Inboxconds);
if (Inboxstart != null)
{
InvokePattern InboxstartInvoke = (InvokePattern)Inboxstart.GetCurrentPattern(InvokePattern.Pattern);
InboxstartInvoke.Invoke();
}
Console.Read();
}
}
}
Thanks,
Bruze
|
|
|
|
|
Good day folks,
I am searching for a specific website, it displays some useful information for me, however, the information is too much and they are not presenting them in a convenient way. Basically the search result is displayed in a grid type control (most likely gridview), I need to click each page number to see all the content if it is not on first page.
So I am wondering if I can do something to save my time? I want to write a httpwebrequest to retrieve the search result and save to local for analysis, that way I need to know how can I let my program to automatically "click" on the page number and get the result on that clicked page.
Can anyone point out some direction for me?
Thank you very much in advance. Any hint is greatly appreciated, currently this is very inconvenient and is costing me too much time every day
|
|
|
|
|
hi, you need to know the parameters send by the page 3 click than you can redirect using the new http request for page 3
i think that would be one way
|
|
|
|
|
Thanks for replying, you know what? actually none of the page number has a unique URL link, so there is no way for you to simply re-create those links for the httpwebrequest. I think those are bunch of doPostBack event for mock up in the httpwebrequest, if possible.
|
|
|
|
|
Good morning all.
I am attempting to set the cursor in a textbox for a user where they can continue to type. In this case I am adding http:// on the textbox enter event.
I would like the curson to 'wait' at the end of the / instead of the https:// being highlighted. If the user doesn't click after the / they will type over the http://.
I have seen some complicated code on the web to simulate a mouse click, but I would prefer a more simpler method.
Any suggestions?
Thank you, WHEELS
|
|
|
|
|
hi,
for you continue typing use "textBox1.SelectionStart = textBox1.Text.Length" if the Text of the textbox is only http:// or https://
if something is written behind the last / you need to search the position of the last / ....
You can set the cursor of the whole textbox to a wait cursor but only at a position you need to programm it your self, that would be a little tricky..
greetz
|
|
|
|
|
Hi rootjumper.
The textBox1.SelectionStart = textBox1.Text.Length is exactly what I was looking for.
Thank you, WHEELS
|
|
|
|
|
HI,
I have developed the windows form with edit controls and static controls which at design time seems ok.
But when I compile the project and run the form and the controls on it shrinks.
I tried adding the Resize event and settings the FormBorderStyle to FixedSingle through which the form seize seems ok but the controls on it still shrinks.
Any kind of help is appreciated
-Regards
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
Ganesh_T wrote: But when I compile the project and run the form and the controls on it shrinks.
Are you running it on a different machine?
|
|
|
|
|
running on Windows 2003 server
IDE is VS2008
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
i mean that could be a bug what IDE you use ?
i got the same behaviour a couple time ago.. i think i solved it with a reinstallation of the IDE
hope i could help
|
|
|
|
|
I am using visual studio 2008 and runnin on windows 2003 server machine
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
i got a check box column in my datagrid.
how should i code to fire check event
|
|
|
|
|
If you are placing your check box in a datatemplate, you could use something like -
<DataTemplate>
<CheckBox Checked="CheckBox_Checked"/>
</DataTemplate>
The check box checked event will then handle check box click.
A click event is also available.
|
|
|
|
|
Hi all,
Some background information:
I have a method A that calls another method B. In method B an asynchronous TCP/IP read occurs: this.tcpClient.GetStream().BeginRead(byteReadBuffer, 0, byteReadBuffer.Length, new AsyncCallback(ProcessReadBuffer), tcpClient.GetStream()); on result method ProcessReadBuffer
So my question:
How can I wait for the asynchronous ProcessReadBuffer method to complete in method B. Reason being that I require some results from ProcessReadBuffer method in method A?
Many thanks in advance.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Why not just call it synchronously then?
Regards,
Rob Philpott.
|
|
|
|
|
|
Try storing the result in an IAsyncResult variable and then call AsyncWaitHandle.WaitOne() on that object.
|
|
|
|
|
Hi,
Thanks for the response.
I did try doing that, but I noticed that the WaitOne() returns immediately with a true result and only then after it goes into the method.
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Strange - this is how I used it -
ar = u.BeginInvoke(param, new AsyncCallback(Complete), "state");
ar.AsyncWaitHandle.WaitOne();
u was the my delegate and param was the parameter I passed into that method that my delegate invoked.
|
|
|
|
|
|
Hey, can anyone point me to tutorials about using the ReportViewer control in Visual Studio 2008? Also please only mention tutorials which are visual (have screenshots).
Thanks
|
|
|
|
|
|
Hi,
I want to connect to an ASP.NET Membership database from a command line as I need to list the user details.
The code I've come up with will connect to a named database easily enough but a membership database is local to an ASP.NET web site so I don't really know what to do. I can locate the MDF and log files easily enough but the database name can't be seen in Management Studio unless I attach to it and I need the database name to get the database owner so that I can then attach to the databse.
If I attach to it in Management Studio, the database name appears to be a large string including the absolute path, but there must be a way of deriving the database name from the MDF file itself, surely?
If I use the name I find in Management Studio I get an error message stating that I can't attach a database with the same name as an existing one! This is when the database is attached in Management Studio. I then detach it in Management Studio, run my code again and when it tries to get the database owner by specifying the database name in the Server.Databases list, I get an unreferenced object error. I'm completely confused!
So what I want to know is, how to I connect to a database using only its MDF file (and LDF file if necessary)?
Thanks
|
|
|
|