Mail & Web
Outsourcing
Shop & CMS
AspNNTP komponentet giver mulighed for at læse og skrive indlæg i en nyhedsgruppe via ASP. Eksemplet nedenfor viser hvordan de 5 første indlæg fra nyhedsgruppen microsoft.public.inetserver.misc udlæses.
Download eksempel: AspNNTP.zip
Det kan anbefales at downloade en demo version af dette komponent for at teste ASP scripts lokalt, inden de køres på webserveren. Download AspNNTP
<html> <head> <title>AspNNTP Demo Script</title> <head> <body> <h2>AspNNTP Demo Script</h2> <% Set NNTP = Server.CreateObject("AspNNTP.Conn") NNTP.Server = " msnews.microsoft.com " if NNTP.SetNewsgroup (" microsoft.public.inetserver.misc ") then Response.Write "First 5 postings from msnews.microsoft.com <p><table border=1>" Response.Write "<tr><td><b>Article</b></td>" Response.Write "<td><b>Subject</b></td>" Response.Write "<td><b>Text</b></td></tr>" For intCount = 1 to 5 NNTP.GetArticleByNumber(NNTP.CurrentArticle) Response.Write "<tr><td valign=top>" & NNTP.CurrentArticle & "</td>" Response.Write "<td valign=top width=150>" & NNTP.Subject & "</td>" Response.Write "<td valign=top><pre>" & NNTP.BodyText & "</pre></td></tr>" NNTP.NextArticle Next Response.Write "</table>" else Response.Write "<p>Unable to open Server or Newsgroup<br>" & VbCrLf Response.Write "Failure was: " & NNTP.Response & "</p>" & VbCrLf end if Set NNTP = nothing %> </body> </html>