Showing posts with label program. Show all posts
Showing posts with label program. Show all posts

Saturday, March 24, 2012

Strip HTML from Text

Is there an easy way to strip HTML tags from Text to get just the plain
text?
I am using a program called FreeTextBox that lets you format Text in a
TextBox. It does this by adding HTML tags (<b>, <u>,<span> etc) to the
code.
The problem is that it is a problem since I am putting the text in a
varChar(8000). The HTML adds a lot characters to the text. I can change
this to a Text field in Sql, but you can do a FullText search on a Text
field (plus I don't really want the tags in a Text Search).
Is there some filtering mechanism that would strip the HTML from a text
field?
Thanks,
TomHere's a complete sample :
http://www.experience247.com/srcvie...tmlIn.cs&font=3
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"tshad" <tscheiderich@.ftsolutions.com> wrote in message
news:%23UjtGFlPGHA.1580@.TK2MSFTNGP09.phx.gbl...
> Is there an easy way to strip HTML tags from Text to get just the plain te
xt?
> I am using a program called FreeTextBox that lets you format Text in a Tex
tBox. It does this by
> adding HTML tags (<b>, <u>,<span> etc) to the code.
> The problem is that it is a problem since I am putting the text in a varCh
ar(8000). The HTML adds
> a lot characters to the text. I can change this to a Text field in Sql, b
ut you can do a FullText
> search on a Text field (plus I don't really want the tags in a Text Search
).
> Is there some filtering mechanism that would strip the HTML from a text fi
eld?
> Thanks,
> Tom
>
That does what I was looking for.
Thanks,
Tom
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:OMXrAJlPGHA.4952@.TK2MSFTNGP09.phx.gbl...
> Here's a complete sample :
> http://www.experience247.com/srcvie...tmlIn.cs&font=3
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "tshad" <tscheiderich@.ftsolutions.com> wrote in message
> news:%23UjtGFlPGHA.1580@.TK2MSFTNGP09.phx.gbl...
>

Strip HTML from Text

Is there an easy way to strip HTML tags from Text to get just the plain
text?

I am using a program called FreeTextBox that lets you format Text in a
TextBox. It does this by adding HTML tags (<b>, <u>,<span> etc) to the
code.

The problem is that it is a problem since I am putting the text in a
varChar(8000). The HTML adds a lot characters to the text. I can change
this to a Text field in Sql, but you can do a FullText search on a Text
field (plus I don't really want the tags in a Text Search).

Is there some filtering mechanism that would strip the HTML from a text
field?

Thanks,

TomHere's a complete sample :

http://www.experience247.com/srcvie...tmlIn.cs&font=3

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"tshad" <tscheiderich@.ftsolutions.com> wrote in message
news:%23UjtGFlPGHA.1580@.TK2MSFTNGP09.phx.gbl...
> Is there an easy way to strip HTML tags from Text to get just the plain text?
> I am using a program called FreeTextBox that lets you format Text in a TextBox. It does this by
> adding HTML tags (<b>, <u>,<span> etc) to the code.
> The problem is that it is a problem since I am putting the text in a varChar(8000). The HTML adds
> a lot characters to the text. I can change this to a Text field in Sql, but you can do a FullText
> search on a Text field (plus I don't really want the tags in a Text Search).
> Is there some filtering mechanism that would strip the HTML from a text field?
> Thanks,
> Tom
That does what I was looking for.

Thanks,

Tom
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:OMXrAJlPGHA.4952@.TK2MSFTNGP09.phx.gbl...
> Here's a complete sample :
> http://www.experience247.com/srcvie...tmlIn.cs&font=3
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "tshad" <tscheiderich@.ftsolutions.com> wrote in message
> news:%23UjtGFlPGHA.1580@.TK2MSFTNGP09.phx.gbl...
>> Is there an easy way to strip HTML tags from Text to get just the plain
>> text?
>>
>> I am using a program called FreeTextBox that lets you format Text in a
>> TextBox. It does this by adding HTML tags (<b>, <u>,<span> etc) to the
>> code.
>>
>> The problem is that it is a problem since I am putting the text in a
>> varChar(8000). The HTML adds a lot characters to the text. I can change
>> this to a Text field in Sql, but you can do a FullText search on a Text
>> field (plus I don't really want the tags in a Text Search).
>>
>> Is there some filtering mechanism that would strip the HTML from a text
>> field?
>>
>> Thanks,
>>
>> Tom
>>

Thursday, March 22, 2012

Strong Password encryption program?

I have a web-based program that will be going to an external web server and
want to create a logon process. I am using forms authentication, passing
encryption with salt, but want to force the user to create passwords with
rules: combinations of numbers & letters, at least one character caps,
things like that, like we would on a a network, and to change the password
every x amount of months. Can anyone point me in the right direction as to
any articles that may help me do this, or the correct process?

Thanks for your help.This is handled at multiple places:

1) Forms authentication allows a user to login into the system for a
session or for a certain amount of time. The way you are handling is
good enough.
2) To have a set of rules for a password, you may use regular
expressions on ASP.NET password textboxes. Search google.
Alternatively, you can write your own logic to validate in code-behind
file or have a trigger in the database of password field, that verifies
the requirement.
3) Password expiry should be maintained by your database logic.
Whenever, a password is updated, update the last updated date and
whenever user login, check if the last updated date is beyond the valid
date time frame. If so, force user to create a new password.

If there are any other ways, please contribute. I'll love to know more
varieties.

Thanks,
Aru
Hello KatMagic,

If you haven't already, take a look at the SqlMembershipProvider api in
ASP.NET 2.0. It has some of what you want built in:

> Configurable password strength
> Automatic lockout
> Minimum number of non-alphanumeric
> Security question/answer
> ...

The membership data are stored in SQL so you have access to the tables,
stored procedures, and functions if you want to customize.

--
enjoy - brians
http://www.limbertech.com

Strong Password encryption program?

I have a web-based program that will be going to an external web server and
want to create a logon process. I am using forms authentication, passing
encryption with salt, but want to force the user to create passwords with
rules: combinations of numbers & letters, at least one character caps,
things like that, like we would on a a network, and to change the password
every x amount of months. Can anyone point me in the right direction as to
any articles that may help me do this, or the correct process?
Thanks for your help.This is handled at multiple places:
1) Forms authentication allows a user to login into the system for a
session or for a certain amount of time. The way you are handling is
good enough.
2) To have a set of rules for a password, you may use regular
expressions on ASP.NET password textboxes. Search google.
Alternatively, you can write your own logic to validate in code-behind
file or have a trigger in the database of password field, that verifies
the requirement.
3) Password expiry should be maintained by your database logic.
Whenever, a password is updated, update the last updated date and
whenever user login, check if the last updated date is beyond the valid
date time frame. If so, force user to create a new password.
If there are any other ways, please contribute. I'll love to know more
varieties.
Thanks,
Aru
Hello KatMagic,
If you haven't already, take a look at the SqlMembershipProvider api in
ASP.NET 2.0. It has some of what you want built in:

> Configurable password strength
> Automatic lockout
> Minimum number of non-alphanumeric
> Security question/answer
> ...
The membership data are stored in SQL so you have access to the tables,
stored procedures, and functions if you want to customize.
enjoy - brians
http://www.limbertech.com