Welcome![Sign In][Sign Up]
Location:
Search - html p

Search list

[Internet-NetworkHTMViewer.zip

Description:

HTML文档显示源代码.


Platform: | Size: 61058 | Author: Gromit2008 | Hits:

[Develop ToolsWSockExpert TCP通信数据分析程序

Description:

WSockExpert .exe TCP通信数据分析程序,可以截取分析所有通过Socket通信的数据内容,有字符串及十六进制模式。而且可以指定进程分析。


Platform: | Size: 260192 | Author: testsb | Hits:

[Internet-Network用Java编写HTML文件分析程序

Description:

Java编写HTML文件分析程序

 一、概述

    

    Web服务器的核心是对Html文件中的各标记(Tag)作出正确的分析,一种编程语言的解释程序也是对源文件中的保留字进行分析再做解释的。实际应用中,我们也经常会碰到需要对某一特定类型文件进行要害字分析的情况,比如,需要将某个HTML文件下载并同时下载与之相关的.gif.class等文件,此时就要求对HTML文件中的标记进行分离,找出所需的文件名及目录。在Java出现以前,类似工作需要对文件中的每个字符进行分析,从中找出所需部分,不仅编程量大,且易出错。笔者在近期的项目中利用Java的输入流类StreamTokenizer进行HTML文件的分析,效果较好。在此,我们要实现从已知的Web页面下载HTML文件,对其进行分析后,下载该页面中包含的HTML文件(假如在Frame中)、图像文件和ClassJava Applet)文件。

    

    二、StreamTokenizer

    

    StreamTokenizer即令牌化输入流的作用是将一个输入流中变成令牌流。令牌流中的令牌实体有三类:单词(即多字符令牌)、单字符令牌和空白(包括JavaC/C++中的说明语句)。

    

    StreamTokenizer类的构造器为: StreamTokenizer(InputStream in)

    

    该类有一些公有实例变量:ttypesvalnval ,分别表示令牌类型、当前字符串值和当前数字值。当我们需要取得令牌(即HTML中的标记)之间的字符时,应访问变量sval。而读向下一个令牌的方法是调用nextToken()。方法nextToken()的返回值是int型,共有四种可能的返回:

    

    StreamTokenizer.TT_NUMBER: 表示读到的令牌是数字,数字的值是double型,可以从实例变量nval中读取。

    

    StreamTokenizer.TT_Word: 表示读到的令牌是非数字的单词(其他字符也在其中),单词可以从实例变量sval中读取。

    

    StreamTokenizer.TT_EOL: 表示读到的令牌是行结束符。

    

    假如已读到流的尽头,则nextToken()返回TT_EOF

    

    开始调用nextToken()之前,要设置输入流的语法表,以便使分析器辨识不同的字符。WhitespaceChars(int low, int hi)方法定义没有意义的字符的范围。WordChars(int low, int hi)方法定义构造单词的字符范围。

    

    三、程序实现

    

    1HtmlTokenizer类的实现

    

    对某个令牌流进行分析之前,首先应对该令牌流的语法表进行设置,在本例中,即是让程序分出哪个单词是HTML的标记。下面给出针对我们需要的HTML标记的令牌流类定义,它是StreamTokenizer的子类:

    

    

    import java.io.*;

    import java.lang.String;

    class HtmlTokenizer extends

    StreamTokenizer {

    //定义各标记,这里的标记仅是本例中必须的,

    可根据需要自行扩充

     static int HTML_TEXT=-1;

     static int HTML_UNKNOWN=-2;

     static int HTML_EOF=-3;

     static int HTML_IMAGE=-4;

     static int HTML_FRAME=-5;

     static int HTML_BACKGROUND=-6;

     static int HTML_APPLET=-7;

    

    boolean outsideTag=true; //判定是否在标记之中

    

     //构造器,定义该令牌流的语法表。

     public HtmlTokenizer(BufferedReader r) {

    super(r);

    this.resetSyntax(); //重置语法表

    this.wordChars(0,255); //令牌范围为全部字符

    this.ordinaryChar('< '); //HTML标记两边的分割符

    this.ordinaryChar('>');

     } //end of constrUCtor

    

     public int nextHtml(){

    int token; //令牌

    try{

    switch(token=this.nextToken()){

    case StreamTokenizer.TT_EOF:

    //假如已读到流的尽头,则返回TT_EOF

    return HTML_EOF;

    case '< ': //进入标记字段

    outsideTag=false;

    return nextHtml();

    case '>': //出标记字段

    outsideTag=true;

    return nextHtml();

    case StreamTokenizer.TT_WORD:

    //若当前令牌为单词,判定是哪个标记

    if (allWhite(sval))

     return nextHtml(); //过滤其中空格

    else if(sval.toUpperCase().indexOf("FRAME")

    !=-1 && !outsideTag) //标记FRAME

     return HTML_FRAME;

    else if(sval.toUpperCase().indexOf("IMG")

    !=-1 && !outsideTag) //标记IMG

     return HTML_IMAGE;

    else if(sval.toUpperCase().indexOf("BACKGROUND")

    !=-1 && !outsideTag) //标记BACKGROUND

     return HTML_BACKGROUND;

    else if(sval.toUpperCase().indexOf("APPLET")

    !=-1 && !outsideTag) //标记APPLET

     return HTML_APPLET;

    default:

    System.out.println ("Unknown tag: "+token);

    return HTML_UNKNOWN;

     } //end of case

    }catch(IOException e){

    System.out.println("Error:"+e.getMessage());}

    return HTML_UNKNOWN;

     } //end of nextHtml

    

    protected boolean allWhite(String s){//过滤所有空格

    //实现略

     }// end of allWhite

    

    } //end of class

    

    以上方法在近期项目中测试通过,操作系统为Windows NT4,编程工具使用Inprise Jbuilder3


Platform: | Size: 1066 | Author: tiberxu | Hits:

[Search Engine求助网系统(仿爱问、类似知道) v4.0 html完整版

Description:

一问多人参与,评论,分享DIGG 多种模式于一体系统,更多好的功能请站长们自己体会吧!


Platform: | Size: 1275154 | Author: vvvv888 | Hits:

[CSharpHtmlPrinter

Description: The HtmlPrinter allows one to print a html page. The source can be a url or a html string.-The HtmlPrinter allows one to print a html p age. The source can be a url or a string html.
Platform: | Size: 60637 | Author: 会员制度 | Hits:

[Delphi VCL带附件及Html显示的邮件发送类

Description:

unit UnitSendMail;

interface

uses
  Windows, SysUtils, Classes,StdCtrls, ExtCtrls, ComCtrls, Dialogs,
  IdMessage, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
  IdExplicitTLSClientServerBase,IdMessageClient, IdSMTPBase, IdSMTP, IdText,
  IDAttachmentFile;

function SendEMail(SenderName, SenderAddress: PChar;
    Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
    JpgFileName: PChar; SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean; stdcall;
function ConnectMailServer(Host, UserName, Password: PChar;
    Port: Integer): Boolean; stdcall;
procedure DisconnectMail; stdcall;

type
  TSendMailObj = class
  private
    FHost: String;
    FPort: Integer;
    FUserName: String;
    FPassword: String;
    ASmtp: TIdSMTP;
  public
    property Host: string read FHost write FHost;
    property Port: Integer read FPort write FPort;
    property UserName: String read FUserName write FUserName;
    property Password: String read FPassword write FPassword;
    constructor Create;
    function ConnectServer: Boolean;
    function SendEMail(SenderName, SenderAddress: PChar;
      Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
      JpgFileName: PChar; SendType: Integer; PicID: PChar;
      IsCustom: Boolean;Attachment:PChar): Boolean;
  end;

var
  SendObj: TSendMailObj;

implementation

function SendEMail(SenderName, SenderAddress: PChar;
    Receivename, ReceiveAddress: PChar; MailSubject, MailContent: PChar;
    JpgFileName: PChar; SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean; stdcall;
begin
  Result :=  SendObj.SendEMail(SenderName, SenderAddress, Receivename,
          ReceiveAddress, MailSubject, MailContent,
            JpgFileName, SendType, PicID, IsCustom,Attachment);
end;

function ConnectMailServer(Host, UserName, Password: PChar;
    Port: Integer): Boolean; stdcall;
begin
  try
    //if SendObj = nil then
    SendObj := TSendMailObj.Create;
{    if SendObj.ASmtp.Connected then
      SendObj.ASmtp.Disconnect;  }
    SendObj.Host := StrPas(Host);
    SendObj.Port := Port;
    SendObj.Username := StrPas(UserName);
    SendObj.Password := StrPas(Password);
    Result := SendObj.ConnectServer;
  except
    Result := False;
  end;
end;

procedure DisconnectMail; stdcall;
begin
  if SendObj <> nil then
  begin
    if SendObj.ASmtp <> nil then
      SendObj.ASmtp.Disconnect;
    SendObj := nil;
    SendObj.Free;
  end;
end;
{ TSendMailObj }

function TSendMailObj.ConnectServer: Boolean;
begin
  ASmtp.Host := FHost;
  ASmtp.Port := FPort;
  ASmtp.Username := FUserName;
  ASmtp.Password := FPassword;
  try
    ASmtp.Connect;
    Result := ASmtp.Connected;
  except
    Result := False;
  end;
end;

constructor TSendMailObj.Create;
begin
  ASmtp := TIdSMTP.Create(nil);

end;

function TSendMailObj.SendEMail(SenderName, SenderAddress, Receivename,
  ReceiveAddress, MailSubject, MailContent, JpgFileName: PChar;
  SendType: Integer; PicID: PChar; IsCustom: Boolean;Attachment:PChar): Boolean;
var
  IdBody, IdHtml: TIdText;
  Att: TIdAttachmentFile;
  AMessage: TIdMessage;
  ASmtp_1: TIdSMTP;
begin
  ASmtp_1 := TIdSMTP.Create(nil);
  ASmtp_1.Host := FHost;
  ASmtp_1.Port := FPort;
  ASmtp_1.Username := FUserName;
  ASmtp_1.Password := FPassword;
  //ASmtp_1.AuthType := atDefault;
  ASmtp_1.Connect; // }
  if not ASmtp.Connected then
    ASmtp.Connect;
  AMessage := TIdMessage.Create(nil);
  with AMessage do
  begin
    NoDecode := False;
    NoEncode := False;
    ContentType := 'multipart/mixed';
    Encoding := meMIME;
    MsgId := 'PrettyPic';
    if FileExists(StrPas(JpgFileName)) then
      References := ChangeFileExt(ExtractFileName(StrPas(JpgFileName)), '')
    else
      References := '';
    Recipients.Clear;
    with Recipients.Add do
    begin
      Name := StrPas(Receivename);
      Address := StrPas(ReceiveAddress);
    end;
    Subject := StrPas(MailSubject);
    Sender.Name := StrPas(SenderName);
    Sender.Address := StrPas(SenderAddress);
    From.Name := Sender.Name;
    From.Address := Sender.Address;
    if SendType = 0 then
    begin
      IdBody := TIdText.Create(MessageParts);
      IdBody.ContentType := 'text/plain';
      IdBody.Body.Add(StrPas(MailContent));
      IdBody.Body.Add('');
    end
    else
    begin
      IdHtml := TIdText.Create(MessageParts);
      IdHtml.ContentType := 'text/html;charset=gb2312';
      IdHtml.ContentTransfer := '7bit';
      IdHtml.Body.Add(' <html>');
      IdHtml.Body.Add('  <head>');
      IdHtml.Body.Add('      <title>' + StrPas(MailSubject) + ' </title>');
      IdHtml.Body.Add('  </head>');
      IdHtml.Body.Add('  <body title="' + References + '">');
      IdHtml.Body.Add('    ' + StrPas(MailContent) + ' <br>');
      if (not IsCustom) and FileExists(StrPas(JpgFileName)) then
        IdHtml.Body.Add('      <img src="cid:' + StrPas(PicID) + '" alt="' + ExtractFileName(StrPas(JpgFileName)) +
                            '" name="' + ExtractFileName(StrPas(JpgFileName)) + '" title="">');
      IdHtml.Body.Add('  </body>');
      IdHtml.Body.Add(' </html>');
    end;
    if FileExists(StrPas(JpgFileName)) then
    begin
      Att := TIdAttachmentFile.Create(MessageParts, StrPas(JpgFileName));
      Att.ExtraHeaders.Values['Content-ID'] := StrPas(PicID);
      Att.ContentType := 'image/jpg';
    end;  
    if FileExists(StrPas(Attachment)) then
    begin
      Att := TIdAttachmentFile.Create(MessageParts, StrPas(Attachment));
    end;
  end;
  try
    ASmtp_1.Send(AMessage);
    if Att <> nil then
      Att.Free;
    if IdBody <> nil then
      IdBody.Free;
    if IdHtml <> nil then
      IdHtml.Free;
    if AMessage <> nil then
      AMessage.Free;
    ASmtp_1.Disconnect;

    ASmtp_1.Free; //}
    ASmtp.Disconnect;
    Result := True;
  except on e: Exception do
  begin
    Result := False;
  end;
  end;

end;

end.


Platform: | Size: 1685 | Author: kennyxue | Hits:

[WEB Code逍遥留言本

Description: 1.界面清新、大方、美观、简洁,功能实用,没有华而不实之处。2.方便的留言管理功能,可在后台删除、关闭或打开、修改、回复留言。3.可在后台打开或关闭留言审核功能,留言审核功能可避免非法、垃圾信息的危害。4.可在后台打开或关闭html屏蔽功能。5.可在后台设置最长留言长度、每页留言条数。6.可在后台修改管理员名称和密码,管理密码使用MD5加密,数据库防下载处理,确保安全。默认的管理员名称均为:www.buyok.net -1. Clean interface, generous, beautiful, simple, functional and practical, not flashy them. 2. A convenient voice management capabilities, can be deleted in the background, closed or open, modify, reply messages. 3. In the background can be opened or closed messages audit functions, message audit functions can avoid illegal spam hazards. 4. In the background can be opened or closed html shielding function. 5. In the background can be set up message length, number of messages per page. 6. Changes in background administrator name and password, password management using MD5 encryption, database-download, ensure safety. The default administrator names are : www.buyok.net
Platform: | Size: 142336 | Author: 韦枫 | Hits:

[OtherHTMLformer

Description: 这是html的ppt讲义,某重点大学的研究生教程。适合初学者系统学习html。-This is the ppt lectures, a focus of the University Graduate Guide. For beginners to study html.
Platform: | Size: 43008 | Author: | Hits:

[ARM-PowerPC-ColdFire-MIPSAT91RM9200-BasicUSARTPDC-GHS3_6-2_0

Description: This zip describes an AT91 USART with PDC Transmission and Reception chain.Includes main.html file for help. For use under Green Hills 3.6.1 Multi?2000 Software Tool. -This describes an porting USARTs with PDC Tr ansmission and main Reception chain.Includes . html file for help. For use under Green Hills 3. 6.1 Multi 2000 Software Tool.
Platform: | Size: 363520 | Author: 张爽 | Hits:

[Othertcpmp

Description: core 24 - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html-core 24-H.264/MPEG-4 AVC codec- Copyleft 2005-JVT
Platform: | Size: 986112 | Author: yangxiong | Hits:

[WEB CodeSnoopy-1.2.3.tar

Description: snoopy是一个php类,用来模仿web浏览器的功能,它能完成获取网页内容和发送表单的任务。 下面是它的一些特征: 1、方便抓取网页的内容 2、方便抓取网页的文字(去掉HTML代码) 3、方便抓取网页的链接 4、支持代理主机 5、支持基本的用户/密码认证模式 6、支持自定义用户agent,referer,cookies和header内容 7、支持浏览器转向,并能控制转向深度 8、能把网页中的链接扩展成高质量的url(默认) 9、方便提交数据并且获取返回值 10、支持跟踪HTML框架(v0.92增加) 11、支持再转向的时候传递cookies-snoopy php is a category used to imitate the web browser function, access to the website can complete this form and content of the mandate. Below are some of its features : a convenience crawls the content of the website two. Grasp the website to facilitate the text (removing HTML code) 3, convenience crawls web link four, five mainframe support agency, support basic user/password authentication model six support custom user agent, referer. cookies, and header as seven support to the browser, and can control the depth to 8, The website can link to expand into high-quality url (default) 9. to facilitate access to data and return value 10, support tracking HTML framework (v0.92 increase) 11. to support the re-transmission of cookies
Platform: | Size: 22528 | Author: 夏一平 | Hits:

[OtherCSSsuchengshouce

Description: CSS就是Cascading Style Sheets,中文翻译为“层叠样式表”,简称样式表,它是一种制作网页的新技术。 网页设计最初是用HTML标记来定义页面文档及格式,例如标题<h1>、段落<p>、表格<table>、链接<a>等,但这些标记不能满足更多的文档样式需求,为了解决这个问题,在1997年W3C(The World Wide Web Consortium)颁布HTML4标准的同时也公布了有关样式表的第一个标准CSS1, 自CSS1的版本之后,又在1998年5月发布了CSS2版本,样式表得到了更多的充实。W3C把DHTML(Dynamic HTML)分为三个部分来实现:脚本语言(包括JavaScript、Vbscript等)、支持动态效果的浏览器(包括Internet Explorer、Netscape Navigator等)和CSS样式表。
Platform: | Size: 325632 | Author: | Hits:

[Delphi/CppBuilderxml_pdf

Description: XML详细范例讲解,从中你可以系统的学习关于XML以及HTML的相关的知识,熟悉页面的基本的制作. -XML examples to explain in detail, from which system you can learn about the relevance of XML and HTML knowledge, familiar with the production of the basic page.
Platform: | Size: 5241856 | Author: 杨李 | Hits:

[WEB Codeeditor

Description: html在线编辑器 html在线编辑器-html online editor online html editor html online editor
Platform: | Size: 147456 | Author: | Hits:

[WEB Codej_10091_wb889

Description: 包括了psd文件和html文件,其中html文件包含了两个,一个是index.html,另一个是假小偷.html 在这里要隆重介绍一下假小偷.html,只要你的电脑能上网,打开就知道,里面的数据自动更新,如果你想拥有一个简单的网站,建议你直接把这个上传到服务器上,就能坐着当站长啦-Including the psd file and html file, html file which contains two, one is the index.html, the other is false thief. Html would like to introduce you leave a grand thief. Html, as long as your computer can access, open on the know , which automatically updates the data, if you want to have a simple website, I suggest you directly to the upload to the server, you can sit when the station you
Platform: | Size: 456704 | Author: | Hits:

[WEB Codehtmledit

Description: html edit 为在线编辑器,可以在文本框内输入任何字符图片,然后在线编辑,此模块将自动把输入的内容转为HTML代码交给相应网页处理-html edit for the online editor, can be in the text box to enter any characters in picture, and then online editor, this module will automatically enter the contents into a HTML code to deal with the corresponding page
Platform: | Size: 1346560 | Author: 李强 | Hits:

[WEB Codefifdoc_html

Description: 本手册是FIF小组推出的《FIF互动帮助手册系列》中的《HTML手册》,其中共收录HTML标签、事件、属性共774个,并附带它们的读音。-This manual is the FIF group launched
Platform: | Size: 3571712 | Author: 李平 | Hits:

[WEB CodeSinaEditor_PHP(08.02.27)

Description: HTML编辑器,很实用,php上传模块 可以用于新闻\博客系统-HTML editor, very practical, php upload module can be used in news blog system
Platform: | Size: 138240 | Author: jackcha | Hits:

[WEB Codewebforms2-0.5.4

Description: 这是一个脚本库能够让你在自己的页面上使用 HTML 5 的强大特性,而不用担心客户端是否支持 HTML。 支持列表如下: Mozilla Firefox 1.0.8 Mozilla Firefox 1.5.0.9 Mozilla Firefox 2 Internet Explorer 6 Internet Explorer 7 Safari 2.0.4 Safari 3(Windows) Opera 9(native experimental implementation)-A cross-browser implementation of the WHATWG Web Forms 2.0 specification. This specification is currently a mature working draft and has been adopted by the W3C HTML Working Group to serve as a starting point for the next version of HTML. This implementation will follow the HTML 5 specification that evolves from the W3C process.
Platform: | Size: 62464 | Author: htz | Hits:

[WEB Codehtml-extractor

Description: 发布一个HTML正文提取程序HTMLExtractor, 程序主要是基于内容统计的方法,暂不包含自学习能力,仅是 一个分析程序而以,网上也有别人实现了的正文提取程序,不过 大部人都当宝,都不愿意公开完整代码,有些大人实现了一些简 单的,不过分析能力和识别能力都不太理想。所以自己做了一个 简单的,本来想用PHP DOM分析器,不过大部份网页都不规范, 缺个标签啥的都很正常,所以自已又造了个简单的轮子分析HTML标 签,功能比较简单,每个元素都生成一个对象,内存方面占用比较 高,不过在这里我只是为了实现,并没去做优化。因为我并不是在 做应用,所以希望不要让我改改成什么样去适用你们的业务(以前经常 有QQ加上让我把我的例子怎么改,很无语), 如果你们喜欢,可以和我一起开发完善他。 补充一下,因为写的着急,现在几个类的耦合性还比较大,下来再守善吧。 项目代码 http://code.google.com/p/html-extractor/ 在线例子 http://dev.psm01.cn/c/html-extractor.php-HTML text extraction procedure to release a HTMLExtractor, Program is mainly based on the content of statistical methods, including self-learning capability temporarily, only An analytical procedure to, the Internet also has the body of someone else realized the extraction process, but When the treasure most people are reluctant to open the complete code, some adults to achieve a number of simple Single, but analysis and recognition are not ideal. So do yourself a Simple, had wanted to use PHP DOM parser, but most of the pages are not standardized, Han s missing tags are normal, so their own and made the wheels of a simple HTML standards Sign, function is relatively simple, each element generates an object, the memory area occupied by comparison High, but I m just here to achieve, it did not do optimization. Because I am not Do apply, so I hope I do not what to change into for your business (before the regular I had QQ with examples of how to change my very silent), If you p
Platform: | Size: 5120 | Author: 小徐 | Hits:
« 12 3 4 5 6 »

CodeBus www.codebus.net