Create MIME Filter for IE wtih C#?

  • Thread starter Thread starter jcorbett
  • Start date Start date
J

jcorbett

Anyone ever done it? I basically need to create an app similar to a
profanity filter... when a certain word in HTML appears, it gets
replaced before the user sees it. The only resources I can find from
Microsoft are written in C++ and are very vague (implement this
interface, implement that interface, instead of sample code). Looking
for help.

Thanks,

--Jon
 
Jon,

Those are pretty much the resources you will have to implement. There
are no .NET conversions, but because of the ability to expose .NET types to
COM (and implement COM interfaces) you are able to do this in .NET. What
are the interfaces that you have to implement?
 
From what I gather, I need:

IInternetProtocolRoot::Start
IInternetProtocolSink::ReportProgress
IInternetProtocolSink::ReportData
IInternetProtocol::Read

...the problem is, I've never worked with COM interfaces before, and I
have no idea how I would write this. Even more general code that
showed how to implement COM interfaces would be helpful.

--Jon


Jon,

    Those are pretty much the resources you will have to implement.  There
are no .NET conversions, but because of the ability to expose .NET types to
COM (and implement COM interfaces) you are able to do this in .NET.  What
are the interfaces that you have to implement?

--
          - Nicholas Paldino [.NET/C# MVP]
          - (e-mail address removed)




Anyone ever done it?  I basically need to create an app similar to a
profanity filter... when a certain word in HTML appears, it gets
replaced before the user sees it.  The only resources I can find from
Microsoft are written in C++ and are very vague (implement this
interface, implement that interface, instead of sample code).  Looking
for help.

--Jon- Hide quoted text -

- Show quoted text -
 
Jon,

For starters, you are going to want to read up on the section of the
MSDN documentation titled "Exposing .NET Framework Components to COM",
located at:

http://msdn2.microsoft.com/en-us/library/zsfww439(VS.80).aspx

As for your particular interfaces (IInternetProtocolRoot,
IInternetProtocolSink, and IInternetProtocol), you are going to have to
define those in your code (with the appropriate marshaling attributes, which
are specified in the link above) and then access them appropriately.

You might also want to look in the header/idl files that these are
defined in, as you will need the IID (interface ids) in order to define them
in .NET.

Looking at http://www.pinvoke.net, there are definitions for the
interfaces you need:

IInternetProtocol -
http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocol.html
IInternetProtocolRoot -
http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocolRoot.html
IInternetProtocolSink -
http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocolSink.html

You can use these definitions, and then just focus on the
implementation.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

From what I gather, I need:

IInternetProtocolRoot::Start
IInternetProtocolSink::ReportProgress
IInternetProtocolSink::ReportData
IInternetProtocol::Read

....the problem is, I've never worked with COM interfaces before, and I
have no idea how I would write this. Even more general code that
showed how to implement COM interfaces would be helpful.

--Jon


Jon,

Those are pretty much the resources you will have to implement. There
are no .NET conversions, but because of the ability to expose .NET types
to
COM (and implement COM interfaces) you are able to do this in .NET. What
are the interfaces that you have to implement?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




Anyone ever done it? I basically need to create an app similar to a
profanity filter... when a certain word in HTML appears, it gets
replaced before the user sees it. The only resources I can find from
Microsoft are written in C++ and are very vague (implement this
interface, implement that interface, instead of sample code). Looking
for help.

--Jon- Hide quoted text -

- Show quoted text -
 
Cool, thanks! :)

--Jon


Jon,

    For starters, you are going to want to read up on the section of the
MSDN documentation titled "Exposing .NET Framework Components to COM",
located at:

http://msdn2.microsoft.com/en-us/library/zsfww439(VS.80).aspx

    As for your particular interfaces (IInternetProtocolRoot,
IInternetProtocolSink, and IInternetProtocol), you are going to have to
define those in your code (with the appropriate marshaling attributes, which
are specified in the link above) and then access them appropriately.

    You might also want to look in the header/idl files that these are
defined in, as you will need the IID (interface ids) in order to define them
in .NET.

    Looking athttp://www.pinvoke.net, there are definitions for the
interfaces you need:

IInternetProtocol -http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocol.html
IInternetProtocolRoot -http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocolRoot....
IInternetProtocolSink -http://www.pinvoke.net/default.aspx/Interfaces/IInternetProtocolSink....

    You can use these definitions, and then just focus on the
implementation.

--
          - Nicholas Paldino [.NET/C# MVP]
          - (e-mail address removed)


From what I gather, I need:

IInternetProtocolRoot::Start
IInternetProtocolSink::ReportProgress
IInternetProtocolSink::ReportData
IInternetProtocol::Read

...the problem is, I've never worked with COM interfaces before, and I
have no idea how I would write this.  Even more general code that
showed how to implement COM interfaces would be helpful.

--Jon

Those are pretty much the resources you will have to implement. There
are no .NET conversions, but because of the ability to expose .NET types
to
COM (and implement COM interfaces) you are able to do this in .NET. What
are the interfaces that you have to implement?
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
AFAIK then ISAPI is a server side technology.

Arne

Yepp, api:s for controlling the IIS before it makes something...

I was thinking about talong the example of setting up a chatt and then
filter
out bad words (profanity filter) on a server that I can control (and
can be sued if missused) with isapi...

Not filtering the client, there should be a lot of parental control
tools for that without programming...

//CY
 
I was thinking about talong the example of setting up a chatt and then
filter
out bad words (profanity filter) on a server that I can control (and
can be sued if missused) with isapi...

I don't know about lawsuits, but profanity filters can cause trouble. For one
thing, the definition varies with culture - in parts of the English-speaking
world the adjective "bloody" is more profane than in others. Also a
discussion like this one, where a word might be cited in an analytical
context, probably shouldn't be filtered as strenuously as a flame rant.

AOL got in trouble with a profanity filter a few years back when all the
members of a breast cancer survivor support community got blocked for having a
discussion about "breasts".
 
AOL got in trouble with a profanity filter a few years back when all the
members of a breast cancer survivor support community got blocked for having a
discussion about "breasts".

Yeah, heard about one that filteerd pics of pigs out, parent control
thinking it was bare skin...

or that might have bean "a rat in the pizza"... never tried it (parent
control at home...), we use surfcontrol at work and it banns all
search eng. like yahoo, alltheweb, but not google
bcause its a lot of not nice words there... but it can be adjusted...
think google was fixed first... or found first then we take them one
by one... (allowing search eng. - not results)

Ohh, really off point... *sorry*

//CY
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top