|
The navigation occurs asynchronously. You should handle the DocumentCompleted [^] event before attempting to access the Document property.
/ravi
|
|
|
|
|
Thanks
|
|
|
|
|
Putting Thread.Sleep() in an event handler is a bad idea, as it prevents your GUI from staying alive, and typically does not solve the problem at all: all it does is "stop the world", so whatever it is you hope will happen in the mean time probably is not happening at all. Use either an asyncrhonous operation, a timer, or another thread.
In your specific case, the Document will not be received until much later, it takes time for the WebBrowser to navigate, receive, and decode the web page. Use DocumentCompleted event (and watch out for multiple events when your page is more complex).
|
|
|
|
|
Please give me the code to split a PDF file using iText.
How to scrap out a range of pages to another pdf file?
|
|
|
|
|
Gjm wrote: using iText.
Check out the IText website to see if you have any samples available.
|
|
|
|
|
I guess you mean iTextSharp. They have a forum which is a better place to get the answer.
|
|
|
|
|
|
hi
i have a problem with ms access db and c#(vs2005) that gonna kill me!
my db has few tables but with many fields, so i want to use wizards and databindings as i can.
i use dataset wizard to add my db into project, then drag tables on my forms.
problem begins with parent/child tables with autoincrement id field in parent table.(i set relation in dataset design view).
in my code at savebutton_click i use this code:
this.validate();
this.parentBindingSource.EndEdit();
this.childBindingSource.EndEdit();
this.parentTableAdapter.Update(this.ds.parent);
this.childTableAdapter.Update(this.ds.child);
but after this i have only one record at parent table and any user input data in child-bounded textboxes disappear!
i think i must update parent table first, then get last id(pk), finally update child table.
but how exactly? any working sample code, please?
everything i found on the web, was about using pure code and DataAdapter Not wizard,dataset and TableAdapter.(tableadapters does not have rowupdated event to trigger to get last inserted pk)...
so please help me before this problem kill me!!
|
|
|
|
|
Whatever you're trying to do, you're probably going about it wrong.
Don't use TableAdapters -- and certainly not Update, they're far too limited in what they can do.
mehdi0016 wrote: i want to use wizards and databindings as i can
What are you trying to accomplish?
|
|
|
|
|
well as i said i have many fields in each table... and i don't want to use command like 'insert(f1, f2, f3, f4,...)'
so databinding is my choose.
i had more search and i found this:
Retrieve Identity value from inserted row in Access Database using TableAdapter
now i have 'rowupdated' event and last inserted id.
but the problem is how to update child table excatly? at parent 'rowupdate' event?
i attached my problem!
testapp1[testapp1]
modified on Saturday, August 7, 2010 12:19 PM
|
|
|
|
|
the key(public and private) is stored in KeyContainer,
I do not export public-key and private-key.
the program run next time, How to get the right public-key and private-key?
please give me the simple code,Thanks.
|
|
|
|
|
You need to save your public key somewhere or ask the user to enter it when the program next runs. The private key should be derived from the public key. Take a look here[^] for some useful samples.
It's time for a new signature.
|
|
|
|
|
You should save your public and private keys somewhere, otherwise how can you use them again later?
Their usage is to make the public key available to everyone you want to exchange encrypted informations with you, and hold the private key somewhere where only you are able to access it
|
|
|
|
|
Then, what does KeyContainer have to use?
the KeyContainer can not store cipherkey ,
Why MS provided it?
What is KeyContainer practical significance?
|
|
|
|
|
jason_mf wrote: What is KeyContainer practical significance?
It's all explained here[^].
It's time for a new signature.
|
|
|
|
|
From the code below, I am trying to get my media player to play or pause. When I click on the button the media plays fine, however the pause does not work it simply starts playing from the start again. How to I get it to pause athen resume?
try
{
if (btnPlay.Content.ToString() == "Play")
{
//Play the media...
mediaElement1.LoadedBehavior = MediaState.Play;
btnPlay.Content = "Pause";
}
else
{
//Pause play back
mediaElement1.LoadedBehavior = MediaState.Pause;
btnPlay.Content = "Play";
}
}
catch (System.IO.FileNotFoundException err)
|
|
|
|
|
I have developed a .Net desctop application, and is planing to create an android application that functions lika a data collecting application.
I have already created a Windows Mobile application and the synchronisation there is through the RAPI, and is planing to make a Android version, since we all know that windows mobile are loosing the mobile-war.
The problem is that I am not sure how to make the .Net desktop applicatin<->Andoid device communication,
The task for the synchronisation feature will be:
1) lockate the data folder for the android application
2) download those files from the android application into a MemStream
3) Delete the files on in the data folder of the android application
I have googled around, but haven't found anything worthwile, so if somebody could point me in the right direction, I would be very grateful.
|
|
|
|
|
Hello everyone,
I have an app that loads an url into the webbrowser control, and then load the source into an object of HTMLAgilityPack, let's call it hap. All of this is working fine, and I can query hap using xpath to find certain items.
What I'd like to do is to add some sort of item selection in the webbrowser control, much like the IE developer tools (F12) has, of item selection by click (Ctrl + B), in a manner I can get the path of this item in the HTML structure.
Does anyone has any idea/tip/link on how to achieve this?
It's a Windows Form app written in C#, but can be converted to other languages, if necessary.
Thanks a lot for help
Marcelo
E O Preço? - Looking for the lowest price? We already found it for you. Price comparision.
|
|
|
|
|
Does this[^] article help?
/ravi
|
|
|
|
|
Hello,
Thanks a lot. It works fine, only struggling to get the selected object.
regards
|
|
|
|
|
Usually as below if you want to check the result of a open file dialog you use the following code:
if (fDialog.ShowDialog() == DialogResult.OK)
{
MessageBox.Show("User clicked on OK / Open");
}
However this does not seem to work when developing a Windows Presentation Foundation based application, any suggestions ?
|
|
|
|
|
In WPF you cannot do that because it returns only Nullable<Boolean>.
So, a code like this should do the trick:
fDialog.ShowDialog();
if (dialog.DialogResult.HasValue && dialog.DialogResult.Value)
{
MessageBox.Show("User clicked on OK / Open");
}
|
|
|
|
|
file web.config makes the following settings for sending:
system.net
mailSettings
smtp
network
host="smtp.mail.ru"
port="25"
userName="username"
password="password"
smtp
mailSettings
system.net
Button "Send"
protected void send_Click(object sender, EventArgs e)
{
try
{
const string ToAddress = "mymail@mail.ru";
MailMessage mm = new MailMessage(UsersEmail.Text, ToAddress);
mm.Subject = Subject.Text;
mm.Body = Body.Text;
mm.IsBodyHtml = false;
SmtpClient smtpClient = new SmtpClient();
smtpClient.Send(mm);
}
catch (Exception exc)
{
L_message.Text = exc.Message.ToString();
}
}
Can not send email.
I use the internet via a proxy server.
Could the reason why this is not the mail is sent?
What can advise me in this situation?.
I tried different ways but not sent.
The exception, "Failed to send e-mail."
|
|
|
|
|
First, please format any code you post here properly. Read the guidance at the top of this forum.
The problem could be the proxy not allowing the traffic. You should look at the details of the exception, not just the message generated.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
how to send a message using a proxy?
|
|
|
|