Click here to Skip to main content
15,888,089 members
Home / Discussions / C#
   

C#

 
QuestionFully Block/Nullify mouse movement/click in C# Pin
Member 381663026-Jul-09 20:54
Member 381663026-Jul-09 20:54 
AnswerRe: Fully Block/Nullify mouse movement/click in C# Pin
Mycroft Holmes26-Jul-09 21:01
professionalMycroft Holmes26-Jul-09 21:01 
GeneralRe: Fully Block/Nullify mouse movement/click in C# Pin
Member 381663026-Jul-09 21:09
Member 381663026-Jul-09 21:09 
GeneralRe: Fully Block/Nullify mouse movement/click in C# Pin
harold aptroot26-Jul-09 21:29
harold aptroot26-Jul-09 21:29 
QuestionIs Index Services Support Contents wildcard to extract/Search text in Files ? Pin
alisolution26-Jul-09 20:05
alisolution26-Jul-09 20:05 
AnswerRe: Is Index Services Support Contents wildcard to extract/Search text in Files ? [modified] Pin
Mycroft Holmes26-Jul-09 20:58
professionalMycroft Holmes26-Jul-09 20:58 
GeneralRe: Is Index Services Support Contents wildcard to extract/Search text in Files ? Pin
alisolution26-Jul-09 21:56
alisolution26-Jul-09 21:56 
Questionwhat are the assemblies required for c# BHO to run in all environment? Pin
svt gdwl26-Jul-09 20:02
svt gdwl26-Jul-09 20:02 
I had a BHO.
When a web page is opened on IE, I try to replace the HTMLElement's text using

foreach (IHTMLElement HtmlElemen in (IHTMLElementCollection)document.body.all)
{
try
{
HtmlElemen.GetType().GetProperty("innerText").SetValue(HtmlElemen, "NewText", null);
}
catch(Exception e)
{
System.Windows.Forms.MessageBox.Show("Message:" + e.Message );
}
}


In some PC's the html element's text is replaced successfully with "Newtext",
but in some PC's it is not replacing.

And an exception message is obtained "Object reference not set to an instance of an object. "

How to fix this exception?

foreach (IHTMLElement HtmlElemen in (IHTMLElementCollection)document.body.all)
{
try
{
Type type =HtmlElemen.GetType();
if(type !=null)
{
type.GetProperty("innerText").SetValue(HtmlElemen, "NewText", null);
}

// same way check Innertext also has not null reference then set value to taht.
}
catch(Exception e)
{
System.Windows.Forms.MessageBox.Show("Message:" + e.Message );
}
}

If I try this code , a message(exception ) is obtained.
Message:Exception has been thrown by the target of an invocation.

I think, I was missing some assembly, what is it to get executed.

May anyone help?
AnswerRe: what are the assemblies required for c# BHO to run in all environment? Pin
SeMartens26-Jul-09 20:59
SeMartens26-Jul-09 20:59 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
svt gdwl26-Jul-09 21:37
svt gdwl26-Jul-09 21:37 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
SeMartens26-Jul-09 21:46
SeMartens26-Jul-09 21:46 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
svt gdwl26-Jul-09 22:29
svt gdwl26-Jul-09 22:29 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
SeMartens26-Jul-09 22:34
SeMartens26-Jul-09 22:34 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
svt gdwl26-Jul-09 23:07
svt gdwl26-Jul-09 23:07 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
SeMartens26-Jul-09 23:09
SeMartens26-Jul-09 23:09 
GeneralRe: what are the assemblies required for c# BHO to run in all environment? Pin
svt gdwl26-Jul-09 23:20
svt gdwl26-Jul-09 23:20 
QuestionNon-Blocking Socket Definition Pin
M Riaz Bashir26-Jul-09 19:41
M Riaz Bashir26-Jul-09 19:41 
AnswerRe: Non-Blocking Socket Definition Pin
Abhijit Jana26-Jul-09 20:12
professionalAbhijit Jana26-Jul-09 20:12 
QuestionHow I can get the Modified date of a file ? Pin
E_Gold26-Jul-09 19:31
E_Gold26-Jul-09 19:31 
AnswerRe: How I can get the Modified date of a file ? Pin
King Julien26-Jul-09 20:12
King Julien26-Jul-09 20:12 
GeneralRe: How I can get the Modified date of a file ? Pin
E_Gold27-Jul-09 2:55
E_Gold27-Jul-09 2:55 
GeneralRe: How I can get the Modified date of a file ? Pin
King Julien27-Jul-09 3:15
King Julien27-Jul-09 3:15 
QuestionArabic Pin
Member 254517626-Jul-09 19:21
Member 254517626-Jul-09 19:21 
AnswerRe: Arabic Pin
Mohammad Dayyan26-Jul-09 19:47
Mohammad Dayyan26-Jul-09 19:47 
Questioncode 4 random number without repeating number in a row . Pin
OLUMADE26-Jul-09 11:48
OLUMADE26-Jul-09 11:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.