Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / December 2007

Tip: Looking for answers? Try searching our database.

Create MIME Filter for IE wtih C#?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jcorbett@fourtentech.com - 24 Dec 2007 17:01 GMT
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
Nicholas Paldino [.NET/C# MVP] - 24 Dec 2007 17:10 GMT
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?

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> 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
[quoted text clipped - 6 lines]
>
> --Jon
jcorbett@fourtentech.com - 24 Dec 2007 17:20 GMT
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

On Dec 24, 12:11 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> Jon,
>
[quoted text clipped - 23 lines]
>
> - Show quoted text -
Nicholas Paldino [.NET/C# MVP] - 24 Dec 2007 17:39 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

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

On Dec 24, 12:11 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> Jon,
>
[quoted text clipped - 24 lines]
>
> - Show quoted text -
jcorbett@fourtentech.com - 24 Dec 2007 17:51 GMT
Cool, thanks! :)

--Jon

On Dec 24, 12:40 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote:
> Jon,
>
[quoted text clipped - 76 lines]
>
> - Show quoted text -
christery@gmail.com - 25 Dec 2007 22:16 GMT
Googling on ISAPI might help

Just a thought

//CY
Arne Vajhøj - 26 Dec 2007 01:10 GMT
> Googling on ISAPI might help

AFAIK then ISAPI is a server side technology.

Arne
christery@gmail.com - 26 Dec 2007 12:57 GMT
> christ...@gmail.com wrote:
> > Googling on ISAPI might help
>
> 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
christery@gmail.com - 26 Dec 2007 13:04 GMT
For a MIME parser (Mail not HTML) in cs there is
http://www.codeproject.com/KB/cs/mime_project.aspx
//CY
Lew - 26 Dec 2007 15:24 GMT
> 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".

Signature

Lew

christery@gmail.com - 26 Dec 2007 18:49 GMT
> 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".
>
> --
> Lew

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.