[问题]Petshop4.0注册提示安全密码问题

mikel阅读(1164)

Petshop4.0 中注册时出现Please enter a more secure password.的解决方法:
在网上找到答案:

查看C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
中membership/providers/add 属性inRequiredNonalphanumericCharacters="1"

知道密码中至少有一个非alpha字符,例如要出现一个@之类的

这 个主要是machine.config配置文件下面的<membership…><providers…> minRequiredPasswordLength="7",minRequiredNonalphanumericCharacters="1" 这两个项要设置
第一项要求了至少密码长度为7,第二项是要求了至少一个非字母数字字符.如果不更改设置,则在密码中包含以下字符"!@#$%^&*()"等中的一个可以解决。或者在web.config文件中更改设置。


<connectionStrings>
  
<add name="MySQLConnection" connectionString="Data Source=MySQLServer;Initial Catalog=aspnetdb;Integrated Security=SSPI;" />
</connectionStrings>
<system.web>
..
<membership defaultProvider="SQLProvider" userIsOnlineTimeWindow="15">
    
<providers>
      
<clear />
      
<add 
        name
="SqlProvider" 
        type
="System.Web.Security.SqlMembershipProvider" 
        connectionStringName
="MySqlConnection"
        applicationName
="MyApplication"
        minRequiredNonalphanumericCharacters
="0" 
        minRequiredPasswordLength
="6" 
        passwordStrengthRegularExpression
="" />
    
</providers>
</membership>

[资源]What is SWFObject 2.0?

mikel阅读(615)

What is SWFObject 2.0?

SWFObject 2.0:

Why should you use SWFObject 2.0?

SWFObject 2.0:

The A List Apart article Flash Embedding Cage Match [ http://www.alistapart.com/articles/flashembedcagematch/ ] describes the full rationale behind SWFObject 2.0.

Why does SWFObject 2.0 use JavaScript?

SWFObject 2.0 primarily uses JavaScript to overcome issues that cannot be solved by markup alone; it:

Should I use the static or dynamic publishing method?

SWFObject 2.0 offers two distinct methods to embed Flash Player content:

  1. The static publishing method embeds both Flash content and alternative content using standards compliant markup, and uses JavaScript to resolve the issues that markup alone cannot solve
  2. The dynamic publishing method is based on marked up alternative content and uses JavaScript to replace this content with Flash content if the minimal Flash Player version is installed and enough JavaScript support is available (similar like previous versions of SWFObject and UFO)

The advantages of the static publishing method are:

  1. The actual authoring of standards compliant markup is promoted
  2. The mechanism of embedding Flash content does not rely on a scripting language, so your Flash content can reach a significant bigger audience:

The advantages of the dynamic publishing method are:

  1. It avoids click-to-activate mechanisms to activate active content in Internet Explorer 6/7 and Opera 9+. Please note that Microsoft is currently phasing out all active content from its Internet Explorer browsers [ http://www.swffix.org/devblog/?p=19 ]
  2. It integrates very well with scripted applications

How to embed Flash Player content using SWFObject 2.0 static publishing

STEP 1: Embed both Flash content and alternative content using standards compliant markup

SWFObject's base markup uses the nested-objects method (with proprietary Internet Explorer conditional comments) [ http://www.alistapart.com/articles/flashembedcagematch/ ] to ensure the most optimal cross-browser support by means of markup only, while being standards compliant and supporting alternative content [ http://www.swffix.org/testsuite/ ]:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 - step 1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  </head>
  <body>
    <div>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
        <param name="movie" value="myContent.swf" />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
        <!--<![endif]-->
          <p>Alternative content</p>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </body>
</html>

NOTE: The nested-objects method requires a double object definition (the outer object targeting Internet Explorer and the inner object targeting all other browsers), so you need to define your object attributes and nested param elements twice.

Required attributes:

  • classid (outer object element only, value is always clsid:D27CDB6E-AE6D-11cf-96B8-444553540000)
  • type (inner object element only, value is always application/x-shockwave-flash)
  • data (inner object element only, defines the URL of a SWF)
  • width (both object elements, defines the width of a SWF)
  • height (both object elements, defines the height of a SWF)

Required param element:

  • movie (outer object element only, defines the URL of a SWF)

NOTE: We advise not to use the codebase attribute to point to the URL of the Flash plugin installer on Adobe's servers, because this is illegal according to the specifications which restrict its access to the domain of the current document only. We recommend the use of alternative content with a subtle message that a user can have a richer experience by downloading the Flash plugin instead.

How can you use HTML to configure your Flash content?

You can add the following often-used optional attributes [ http://www.w3schools.com/tags/tag_object.asp ] to the object element:

  • id
  • name
  • class
  • align

You can use the following optional Flash specific param elements [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 ]:

Why should you use alternative content?

The object element allows you to nest alternative content inside of it, which will be displayed if Flash is not installed or supported. This content will also be picked up by search engines, making it a great tool for creating search-engine-friendly content. Summarizing, you should use alternative content when you like to create content that is accessible for people who browse the Web without plugins [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement_03.html ], create search-engine-friendly content [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement_04.html ] or tell visitors that they can have a richer user experience by downloading the Flash plug-in.

STEP 2: Include the SWFObject JavaScript library in the head of your HTML page

The SWFObject library consists of one external JavaScript file. SWFObject will be executed as soon as it is read and will perform all DOM manipulations as soon as the DOM is loaded – for all browsers that support this, like IE, Firefox, Safari and Opera 9+ – or otherwise as soon as the onload event fires:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 - step 2</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
  </head>
  <body>
    <div>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
        <param name="movie" value="myContent.swf" />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
        <!--<![endif]-->
          <p>Alternative content</p>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </body>
</html>

STEP 3: Register your Flash content with the SWFObject library and tell SWFObject what to do with it

First add a unique id to the outer object tag that defines your Flash content. Second add the swfobject.registerObject method:

  1. The first argument (String, required) specifies the id used in the markup.
  2. The second argument (String, required) specifies the Flash player version your content is published for. It activates the Flash version detection for a SWF to determine whether to show Flash content or force alternative content by doing a DOM manipulation. While Flash version numbers normally consist of major.minor.release.build, SWFObject only looks at the first 3 numbers, so both "WIN 9,0,18,0" (IE) or "Shockwave Flash 9 r18" (all other browsers) will translate to "9.0.18".
  3. The third argument (String, optional) can be used to activate Adobe express install [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 ] and specifies the URL of your express install SWF file. Express install displays a standardized Flash plugin download dialog instead of your Flash content when the required plugin version is not available. A default expressInstall.swf file is packaged with the project. It also contains the corresponding expressInstall.fla and AS files (in the SRC directory) to let you create your own custom express install experience. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
    </script>
  </head>
  <body>
    <div>
      <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
        <param name="movie" value="myContent.swf" />
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
        <!--<![endif]-->
          <p>Alternative content</p>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      </object>
    </div>
  </body>
</html>

TIPS

How to embed Flash Player content using SWFObject 2.0 dynamic publishing

STEP 1: Create alternative content using standards compliant markup

SWFObject's dynamic embed method follows the principle of progressive enhancement [ http://www.adobe.com/devnet/flash/articles/progressive_enhancement.html ] and replaces alternative HTML content for Flash content when enough JavaScript and Flash plug-in support is available. First define your alternative content and label it with an id:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 dynamic embed - step 1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  </head>
  <body>
   
    <div id="myContent">
      <p>Alternative content</p>
    </div>
   
  </body>
</html>

STEP 2: Include the SWFObject JavaScript library in the head of your HTML page

The SWFObject library consists of one external JavaScript file. SWFObject will be executed as soon as it is read and will perform all DOM manipulations as soon as the DOM is loaded – for all browsers that support this, like IE, Firefox, Safari and Opera 9+ – or otherwise as soon as the onload event fires:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 dynamic embed - step 2</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
    <script type="text/javascript" src="swfobject.js"></script>
  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
  </body>
</html>

STEP 3: Embed your SWF with JavaScript

swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes) has five required and four optional arguments:

  1. swfUrl (String, required) specifies the URL of your SWF
  2. id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
  3. width (String, required) specifies the width of your SWF
  4. height (String, required) specifies the height of your SWF
  5. version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release")
  6. expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 ]. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
  7. flashvars (Object, optional) specifies your flashvars with name:value pairs
  8. params (Object, optional) specifies your nested object element params with name:value pairs
  9. attributes (Object, optional) specifies your object's attributes with name:value pairs

NOTE: You can omit the optional parameters, as long as you don't break the parameter order. If you don't want to use an optional parameter, but would like to use a following optional parameter, you can simply pass false as its value. For the flashvars, params and attributes JavaScript Objects, you can also pass an empty object instead: {}.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject v2.0 dynamic embed - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
   
    <script type="text/javascript">
    swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
    </script>
  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
  </body>
</html>

How can you configure your Flash content?

You can add the following often-used optional attributes [ http://www.w3schools.com/tags/tag_object.asp ] to the object element:

  • id (NOTE: when undefined, the object element automatically inherits the id from the alternative content container element)
  • name
  • styleclass (used instead of class, because this is also an ECMA4 reserved keyword)
  • align

You can use the following optional Flash specific param elements [ http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701 ]:

How do you use JavaScript Objects to define your flashvars, params and object's attributes?

You can best define JavaScript Objects using the Object literal notation, which looks like:

<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

You can add your name:value pairs while you define an object (note: please make sure not to put a comma behind the last name:value pair inside an object)

<script type="text/javascript">
var flashvars = {
  name1: "hello",
  name2: "world",
  name3: "foobar"
};
var params = {
  menu: "false"
};
var attributes = {
  id: "myDynamicContent",
  name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

Or add properties and values after its creation by using a dot notation:

<script type="text/javascript">
var flashvars = {};
flashvars.name1 = "hello";
flashvars.name2 = "world";
flashvars.name3 = "foobar";
var params = {};
params.menu = "false";
var attributes = {};
attributes.id = "myDynamicContent";
attributes.name = "myDynamicContent";
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

Which can also be written as (the less readable shorthand version for the die-hard scripter who love one-liners):

<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", {name1:"hello",name2:"world",name3:"foobar"}, {menu:"false"}, {id:"myDynamicContent",name:"myDynamicContent"});
</script>

If you don't want to use an argument you can define it as false or as an empty Object:

<script type="text/javascript">
var flashvars = false;
var params = {};
var attributes = {
  id: "myDynamicContent",
  name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

The flashvars Object is a shorthand notation that is there for your ease of use. You could potentially ignore it and specify your flashvars via the params Object:

<script type="text/javascript">
var flashvars = false;
var params = {
  menu: "false",
  flashvars: "name1=hello&name2=world&name3=foobar"
};
var attributes = {
  id: "myDynamicContent",
  name: "myDynamicContent"
};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>

TIPS

SWFObject 1.5 to SWFObject 2.0 migration tips

  1. SWFObject 2.0 is NOT backwards compatible with SWFObject 1.5
  2. It is now preferred to insert all script blocks in the head of your HTML page
  3. The library itself is now written in lowercase: swfobject instead of SWFObject
  4. Methods can only be accessed via the library (instead via a SWFObject instance in SWFObject 1.5)
  5. The API is entirely different and more elaborate: [ http://code.google.com/p/swfobject/wiki/SWFObject_2_0_api_javascript_dev ]
  6. SWFObject 2.0 replaces your entire alternative HTML content block, including the referenced HTML container element, for Flash content when enough JavaScript and Flash support is available, while SWFObject 1.5 only replaces the content inside the referenced HTML container. When you don't specify an id attribute, the object element will automatically inherit the id of the HTML container element of your alternative content.

UFO to SWFObject 2.0 migration tips

  1. SWFObject 2.0 replaces your entire alternative HTML content block, including the referenced HTML container element, for Flash content when enough JavaScript and Flash support is available, while UFO only replaces the content inside the referenced HTML container. When you don't specify an id attribute, the object element will automatically inherit the id of the HTML container element of your alternative content.
  2. UFO's setcontainercss feature has not been incorporated in SWFObject 2.0, however it can easily be replicated by using the SWFObject 2.0 API, see: swfobject.createCSS(selStr, declStr) in [ http://code.google.com/p/swfobject/wiki/SWFObject_2_0_api_javascript_dev ]

Does SWFObject 2.0 support MIME type application/xhtml+xml?

SWFObject does NOT support XML MIME types, which is a design decision.

There are a number of reasons why we are not supporting this:

COMMENTS POLICY

We will try to keep this page lean and mean, because it is used by many people. For this purpose we will periodically review all comments and remove all comments that are outdated or irrelevant to this documentation page itself.

If you have any questions/comments about SWFObject 2.0 or have problems with an implementation:

  1. Please make sure you have read our FAQ [ http://code.google.com/p/swfobject/wiki/SWFObject_2_0_faq_web_authors ]
  2. Use the SWFObject 2.0 discussion group [ http://groups.google.com/group/swfobject ]

If you find any bugs or want to request a future enhancement, you can fill in an issue report on the SWFObject 2.0 issues page [ http://code.google.com/p/swfobject/issues/list ]

[教程]Live Camera Previews in Android

mikel阅读(795)

This code replaces an earlier version which is still available

The Android SDK provided by Google doesn't provide any camera emulation beyond a stand-in animation (see below). Since Google haven't yet provided a working implementation (or even a date by which one will be available), I'm publishing the source code for a set of temporary classes that I wrote to overcome this limitation. It's the first code I wrote on the Android platform, and it was written in haste, though it has functioned very well for me.

The code is public domain. I make no warranty as to its fitness for any particular purpose.

The code consists of:

  • CameraSource
    A light interface that protects client code from the choice of camera.
  • GenuineCamera
    A CameraSource implementation that uses the device's camera.
  • HttpCamera
    A CameraSource implementation that GETs images over an HTTP connection.
  • SocketCamera
    A CameraSource implementation that obtains images directly over a TCP/IP connection.
  • BitmapCamera
    A CameraSource implementation that uses a supplied bitmap.
  • WebcamBroadcaster
    A small Java application that uses JMF to broadcast captured stills over the network.

Results

When drawing the output of the genuine camera to screen, you will see something that looks like this:

Device's Camera preview output.

When drawing the output of a remote camera that is obtaining frames from a running webcam broadcaster you would see this (if you were stood over my desk).

Still obtained from a webcam broadcaster.

To save myself more time, I chose to produce a small settings configuration activity too (the code for which is not included).

A simple configuration activity for the camera settings.

Usage

Using a camera source is very simple:

CameraSource cs = new SocketCamera("192.168.0.100", 9889, 320, 240, true); if (!cs.open()) { /* deal with failure to obtain camera */ } while(/*some condition*/) { cs.capture(canvas) //capture the frame onto the canvas } cs.close();

The HttpCamera implementation should be able to obtain stills from any HTTP serving webcam or webcam software. At present I am using WebCam2000 which I run under Windows XP.

Fabian Necci kindly emailed me to let me know that he has successfully used this code on a MacBook using EvoCam to publish JPEG frames to an internal web server. Other software should be available on other systems.

Torben Vesterager has used the code with his MacBook Pro laptop which has Apple's own iSight built-in. He reports that the camera only supports YUVFormats and so had to change the code in the WebcamBroadcaster to use YUVFormat instead of RGBFormat.

Jeffrey Sharkey has used Gentoo Linux with a Logitech QuickCam express using the WebcamBroadcaster and the Linux-native JMF library. He followed this by using DV4Linux to get JMF to recognize his firewire MiniDV camera. This gave him much clearer pictures in Android; he wrapped his JMF calls using the dv4lstart utility:

dv4lstart jmfinit dv4lstart java WebcamBroadcaster

If you successfully use this code on a platform other than those listed above, or have used other webcam software, please let me know so that I can include it in this documentation for the benefit of others.

The SocketCamera implementation relies on a WebcamBroadcaster to be serving webcam stills from the address & port specified in its constructor.

To run a WebcamBroadcaster you will need JMF installed and you may need to supply the library location to the JVM when you run the application (this depends on how you install it). For example, on my machine (currently Windows XP) I use:

java "-Djava.library.path=C:\Program Files\JMF2.1.1e\lib" WebcamBroadcaster

You can pass the following combination of parameters to the application, all of which are strictly positive integers (all dimensions in pixels):

  • WebcamBroadcaster port
  • WebcamBroadcaster width height
  • WebcamBroadcaster width height port

Alternatively, you may provide no parameters, in which case the defaults are width: 320, height: 240 and port: 9889.

Notes

  • I am not able to provide support/advice relating to JMF. Sorry, but the library is old and the documentation stale. I am using it here because its the quickest option, not necessarily the best. You can reimplement the WebcamBroadcaster application using any language/library you choose, so long as it emulates the extremely simple behaviour of the WebcamBroadcaster class. For an easy life I recommend using the HttpCamera implementation.
  • The SocketCamera implementation can be expected to outperform the HttpCamera implementation significantly.
  • Obviously performance is poor, every frame needs to be compressed, sent over a network and then decompressed. This is not a useful long term implementation. Nevertheless, performance isn't so bad that the code is unusable. On my machine, capturing a frame using SocketCamera takes about 100-150ms, HttpCamera is typically two to three times slower.
  • Android currently features a very significant bug that disregards the connect timeout setting for URL connections. Until that bug is fixed, the HttpCamera implementation will hang the first time it fails to connect to the webcam server. I believe this bug was resolved in the m5 emulator releases, but have not confirmed it.
  • When capturing a sequence of stills, JMF has a habit of 'freezing' on a single frame. If this happens, just stop and start the WebcamBroadcaster application. You do not need to restart your Android application.
  • I don't recommend using "localhost" when specifying an address to which the camera should connect. The Android device will probably treat this as the loopback on the emulated device itself. Instead use the IP address of the machine which is hosting the webcam (or WebcamBroadcaster).

[文档]Adobe Flex3 SDK说明文档

mikel阅读(1084)

此文档包含Adobe® Flex® 3 SDK的发布说明和安装说明。
           • 关于Flex 3 SDK
           • 新特性
           • 安装说明
           • 兼容性问题
           • 已知问题
           • Flex Builder 3发行说明
           • Flex 3文档

关于Flex 3 SDK
      Flex 3 SDK包括Flex框架(也称为Flex类库)、Flex命令行编译器、Flex调试器、ASDoc实用工具和调试器版本的Flash Player。使用Flex SDK可以开发、编译和部署Flex应用程序,这些应用程序将连接到XML和SOAP Web服务,或者连接到各种服务器技术,比如使用诸如BlazeDS之类的服务器技术的PHP、ColdFusion、Java和.NET。

新特性

       本节将列出Flex 3 SDK的一些主要新特性和更改。有关新特性的更多信息,请访问 Flex开发人员中心
       Adobe® AIR™的本机支持——Flex 3增加了对Adobe AIR的支持,后者允许开发人员在HTML、AJAX、Flash和Flex中使用现有Web技术构建RIA并将其部署到桌面系统中。Flex 3引入了一些新组件,并将Adobe AIR开发工具囊括到SDK和Flex Builder中。
持久性框架缓存——在对Adobe平台组件利用新的Flash Player缓存时,可使Flex 3应用程序的大小减少到50K。
Advanced DataGrid组件——Advanced DataGrid是一个新组件,通常用于将请求的特性添加到DataGrid中,比如对分层数据的支持和基本透视表功能。只可与Flex Builder Professional一起使用。
OLAP DataGrid组件——An OLAP(在线分析处理)网格数据允许以紧凑格式聚合数据,并用由行和列组成的二维网格显示这些数据聚合。只可与Flex Builder Professional一起使用。
Enhanced Constraints布局机制——Enhanced Constraints构建在已有的基于约束的布局机制之上,允许使用兄妹关系约束(在Flex 2中只可以定义父子约束)创建复杂的、可重新调整大小的布局。
Flex Charting包增强——Flex 3通过许多增强改进了Charting包。坐标系统现在只可以支持几个轴,DateTimeAxis允许执行工作周过滤。新的面向数据的图形API允许绘 制数据坐标,用图表呈现适当屏幕位置上的一切内容。对于现有所有图表,还有一些新格式选项和新添加的交互功能。只可与Flex Builder Professional一起使用。
Flex Component Kit for Flash CS3——Flex Component Kit for Flash CS3提供了用于创建可无缝集成到Flex应用程序中的Flash内容的完整工作流。Flash用户现在可以使用熟悉的Flash时间轴模型开发组件,然 后通过使用少许简单的模式使Flex开发人员能够引入这些组件,而无需添加额外代码。Flex Component Kit for Flash CS3可从Adobe 网站获得。
Flex Ajax Bridge库——Flex 3现在包括Flex Ajax Bridge (FABridge)、一个可插入Flex应用程序的小型代码库、一个Flex组件或一个空SWF文件(可以导出该文件实现浏览器中的脚本编写)。使用 FABridge可以使ActionScript类可用于JavaScript,无需编写任何额外编码。在插入库之后,就可以使用JavaScript实 现用ActionScript实现的任何操作。
Flex转向开源——Adobe Flex现在是开源的,包含用于框架、编译器、调试器以及更多可在Mozilla Public License下使用的工具的源代码。更多信息请访问 http://opensource.adobe.com/flex

安装说明

         Flex SDK安装是以ZIP文件形式提供的,其中包含Flex框架、Adobe AIR框架和命令行工具,比如mxmlc命令行实用工具、Adobe AIR命令行实用工具、ASDoc实用工具、Flex命令行调试器和调试器版本的Flash Player。
卸载当前的Flash Player

         应该让Flex SDK与最新版本的调试Flash Player一起使用,因此,在安装Flex SDK之前,应该卸载当前的Flash Player。
基于Windows插件的浏览器
          运行从此 技术说明 获得的适当卸载工具。
Macintosh
          运行从此 技术说明 获得的适当卸载工具。
Linux
手动移除(对于已通过Install脚本安装了插件的用户):
        • 删除libflashplayer.so二进制文件和目录
           /home/<user>/.mozilla/plugins/中的flashplayer.xpt文件
RPM移除:
       1. 在根目录下输入以下命令:
           # rpm -e flash-plugin
       2. 单击回车键并按照提示进行操作。
安装Flex SDK
        1. 从 Adobe网站 下载Flex SDK ZIP文件。
        2. 创建用于包含Flex SDK的目录。
        3. 将Flex SDK ZIP文件解压缩至此目录中。Flex SDK包含以下目录:
                o  /ant — 包含Flex Ant Tasks。
                o  /asdoc — 包含ASDoc工具的帮助文件,该工具根据MXML和ActionScript源代码创
                   建HTML文档。
                o  /bin — 包含mxmlc、compc、asdoc和fdb实用工具。bin目录也包含jvm.config文件,
                   该文件指定了可修改的Java设置(如果需要的话)。
                o  /frameworks — 包含已编译的框架类、配置文件和框架源代码。
                o  /lib — 包含供实用工具使用的JAR文件。
                o  /runtimes — 包含air目录中AIR运行库的安装程序,以及player目录中调试版
                    Flash Player 9的安装程序。
                o  /samples — 包含示例应用程序。
                o   /templates — 包含用于Flash Player检测和浏览器集成的HTML模板,在air文件夹
                   中,还有一个示例Adobe AIR application.xml文件。
         4. 确保计算机上已安装Java Runtime Environment(JRE),并且系统路径中已经定义了java_home/bin目录。要求使用JRE 1.4、1.5或1.6。对于1.4,则需要JRE 1.4.2_06或更高的版本。
         5. 从install_root/runtimes/player/platform目录安装适当的调试Flash Player。
         6. (可选)完成Flash Player安装之后,重新启动计算机,确保激活已更新的Flash Player浏览器。
         7. 查看浏览器示例,继续后面的操作。要运行浏览器示例,必须先运行install_root/samples/explorer/build.bat (Windows)或install_root/samples/explorer/build.sh(UNIX和Mac OS X)文件对其进行编译。有关Flex编译器的更多信息,请参阅《Building and Deploying Flex Applications》手册中的"Using the Flex Compilers"一章。

兼容性问题

向后兼容性编译器参数——有许多Flex SDK后向兼容性更改,其中包括可以使用新兼容性参数-compatibility-version将行为返回给Flex 2.0.1。要获得完整的细节描述,请参阅 Flex 3: Backwards Compatibility。
-compatibility-version参数不支持的向后兼容性问题——一些向后兼容性问题可能会影响在Flex 2.0.1中构建的应用程序。这些问题涉及以下组件的行为和配置设置:
           • flashType——flashType已过时
           • ComboBox ItemRenderer——paddingLeft配置方式的更改
           • DataGrid——DataGrid行为兼容性问题包括verticalScrollBar、rowCount、
              lockedRowCount、verticalSeperatorSkin和headerStyle。
           • 列表——选择对应于null项的基于列表的组件。
           • 按钮——使用自定义selectedUpSkin、selectedDownSkin和selectedOverSkin的按钮无法
             正确调整大小。
           • UITextField——过去受到保护的UITextField现在是类型IUITextField。
           • TileList——在使用pageDown键滚动项的时候,TileList具有不同的行为。
           • keep-as3-metadata——已从flex-config.xml中移除keep-as3-metadata。
           • 语言环境——语言环境现在包含在frameworks.swc中,在指定语言环境时将引发其他相关
             问题。
关于这些兼容性问题的详细信息,请参阅 Changes Not Supported By The Backwards Compatibility Flag,它是 Flex 3: Backwards Compatibility 文档中的一节。

已知问题
         本节包含选定的已知问题。有关Flex Builder问题及其状态的完整列表,请参阅 公共bug库。公共bug库允许搜索已知问题、关于它们的评论并添加新bug。
提示:可以使用Filters自定义您的搜索。
http://bugs.adobe.com/jira/browse/SDK-14289——深层链接无法与SSL一起使用
http://bugs.adobe.com/jira/browse/SDK-14440——无法打开已关闭的窗口。
http://bugs.adobe.com/jira/browse/SDK-12150——即使在application.xml中设置visible=false,WindowedApplication也仍然可见
http://bugs.adobe.com/jira/browse/SDK-873——启动Module中的PopUps可能会造成运行时错误(RTE)。
http://bugs.adobe.com/jira/browse/SDK-14298——在与Window组件中的容器一起使用creationPolicy=”queued”时,会导致异常
http://bugs.adobe.com/jira/browse/SDK-12787——在使用历史管理器时,无法存储第一个历史。
http://bugs.adobe.com/jira/browse/SDK-12694——无法在WindowedApplication中使用PrintDataGrid,除非明确指定宽度和高度。
http://bugs.adobe.com/jira/browse/SDK-10970——尝试使用SWFLoader加载远程swf时会在AIR中造成安全错误。
http://bugs.adobe.com/jira/browse/SDK-9421—— 分析器UI中缺少后向引用。在某些情况下,分析器可能不显示任何针对闲散对象的后向引用。这种情况多数发生于非堆(non-heap)对象,比如ABC解 码期间创建的String。要研究没有后向引用的闲散对象,请参阅配置追踪文件,该文件必须通过Launch Dialog激活。
http://bugs.adobe.com/jira/browse/SDK-14615——将Window或WindowedApplication的可见属性设置为false后,hideEffect仍不起作用。

[教程]解决SQLServer2005连接错误问题方法

mikel阅读(1100)

错误:"在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: 命名管道提供程序, error: 40 – 无法打开到 SQL Server 的连接) "

 

      上述错误我遇到两种情况,一种是在打开打开SQL Server 2005时弹出的,另一种是在应用程序连接SQL Server 2005时出现的.归纳了一下,由以下几个原因:

1.数据库引擎没有启动.

      有两种启动方式:

     (1)开始->程序->Microsoft SQL Server 2005->SQL Server 2005外围应用配置器,在打开的界面单击"服务的连接的外围应用配置器",在打开的界面中找到Database Engine,单击"服务",在右侧查看是否已启动,如果没有启动可单击"启动",并确保"启动类型"为自动,不要为手动,否则下次开机时又要手动启动;

     (2)可打开:开始->程序->Microsoft SQL Server 2005->配置工具->SQL Server Configuration Manager,选中SQL Server 2005服务中SQL Server(MSSQLServer) ,并单击工具栏中的"启动服务"按钮把服务状态改为启动;

      使用上面两种方式时,有时候在启动的时候可能会出现错误,不能启动,这时就要查看"SQL Server 2005配置管理器"中的SQL  Server 2005网络配置->MSSQLServer协议中的VIA是否已启用,如果已启用,则把它禁止.然后再执行上述一种方式操作就可以了.

2.进行远程连接时,是否已允许远程连接.

      SQL Server 2005 在默认情况下仅限本地连接.我们可以手动启用远程连接.在上面第一种方式中,找到Database Engine,单击"远程连接",在右侧将"仅限本地连接(L)"改为"本地连接和远程连接(R)",并选中"同时使用TCP/IP和named pipes(B)".

3.如果是远程连接,则还要查看连接数据库的语句是否正确,登录账户是否正确,密码是否正确等.

      我在一次局域网内连接数据库时,就要因为连接字符串出了问题,在局域网内一台机子连接另一台机子上数据库时,把server=装有数据库的另一台机子的 IP.我在连接数据库时总是出现上面的错误,查了好长时间,后来发现,IP没有正确到传到连接字符串,原来我在连接时,使用的是本地,即 127.0.0.1,输入的IP没有传到连接字符串.

     以上是我归纳的几种情况,希望能对遇到类似问题的朋友提供些帮助和参考.

[教程]修改SQLServer2005的端口号

mikel阅读(961)

如果启用,则 Microsoft SQL Server Database Engine 的默认实例将侦听 TCP 端口 1433。SQL Server Database Engine 和 SQL Server Mobile 的命名实例的配置是使用动态端口,这意味着它们在启动 SQL Server 服务时会选择一个可用端口。在通过防火墙连接到命名实例时,请配置数据库引擎 以侦听特定端口,以便能够在防火墙中打开相应的端口。
为 SQL Server 数据库引擎分配 TCP/IP 端口号
在 SQL Server 配置管理器中的控制台窗格中,依次展开“SQL Server 2005 网络配置”、“<实例名> 的协议”,然后双击 TCP/IP。
在“TCP/IP 属性”对话框的“IP 地址”选项卡上,将显示若干个 IP 地址,格式为:IP1、IP2,直到 IPAll。这些 IP 地址中有一个是用作环回适配器的 IP 地址 (127.0.0.1) 的。其他 IP 地址是计算机上的各个 IP 地址。右键单击每个地址,再单击“属性”,标识要配置的 IP 地址。
如果“TCP 动态端口”对话框中包含 0,则表示数据库引擎 正在侦听动态端口,请删除 0。
在“IPn 属性”区域框的“TCP 端口”框中,键入希望此 IP 地址侦听的端口号,然后单击“确定”。
在控制台窗格中,单击“SQL Server 2005 服务”。
在详细信息窗格中,右键单击“SQL Server (<实例名>)”,再单击“重新启动”,以停止并重新启动 SQL Server。
在配置完 SQL Server 以侦听特定端口后,可以通过下列三种方法,使用客户端应用程序连接到特定端口:
运行服务器上的 SQL Server Browser 服务以按名称连接到数据库引擎 实例。
在客户端上创建一个别名,指定端口号。
对客户端进行编程,以便使用自定义连接字符串进行连接。

[教程]与Patrick Smacchia谈.NET的代码分析

mikel阅读(878)

Patrick Smacchia是Visual C#的MVP,拥有超过15年的软件开发经验。他是《Practical .NET 2 and C# 2》一书的作者,该书通过真实的项目经验来阐释.NET平台。他的专业为数学与计算机科学,毕业后,他在多个领域从事过软件开发,包括在Société Générale开发股票交易系统,在Amadeus开发航空售票预订系统,以及在Alcatel开发卫星基站。目前他是NDepend工具的首席程序员。

Rob Bazinet (RB): NDepend是什么?

Patrick Smacchia (PS): NDepend是为.NET开发人员以及架构师开发的工具。代码库是那么的错综复杂,而NDepend工具则能够帮助人们从源代码中获取相关的信息。例如,NDepend能够判断你的代码库是否正确分层;获知从最近版本发布后所做的修改;或者评估某些关键任务的代码质量,如果这些事情通过传统工具来完成,可能会耗费数个小时甚至数天的时间。

RB: 是什么使你产生开发NDepend的念头?

PS: 5年前,我为一个巨大而又混乱的代码库提供咨询。而在同时,我正在阅读一本优秀的书籍,Robert C Martin所著的《敏捷软件开发——原则,模式与实践》 。本书描述了一些非常酷的评估代码库组件构成的度量标准。

正是在那个时候,我从C++转向了.NET。我所偏爱的其中一个特性是System.Reflection,它比C++的RTTI更加的引人注目。顺理成章的,我开始基于反射开发了一个小巧的工具,它能够针对这个巨大而又混乱的代码库去验证Martin所说的度量。然后,我将该工具发布为开源软件(OSS),由于它的功能能够满足许多需求,因而越来越受到人们的欢迎。基于此,我认识到如果该工具能够支持某些可视化以及查询的功能,那么对于我们处理代码复杂性而言,其效率就能再上一个台阶。

RB: NDepend对于我的编码工作以及/或者开发生命周期能够提供怎样的帮助呢?

PS: NDepend对多种任务都提供了很大的帮助,包括重构、代码评审、代码质量检查与增强、设计缺陷检查、代码侦测、代码浏览以及构建过程原则的实施。

NDepend对于代码重构非常有用,因为它能够展现组件、命名空间、类……之间的依赖关系,呈现的方式是一个依赖关系矩阵图以及一些由“框框和箭头”组成的图形。

NDepend支持超过60条编码准则,用于评估代码质量:

NDepend分析过程可以被集成到MSBuild或者NAnt构建过程中。每次执行分析之后都会给出一个关于构建过程健康度的报告。

通过使用代码查询语言(Code Query Language,CQL,一种能够提供代码结构查询的语言),开发人员能够对他们的代码库提出各种问题:

  • 哪些类实现了IDisposable接口?
    Select TYPES Where IsClass AND Implements "System.IDisposable"
  • 哪些公共方法能够被声明为private?
    Select METHODS Where IsPublic AND CouldBePrivate
  • 哪些方法分配了特定的字段?
    Select METHODS Where IsDirectlyWriting "MyNamespace.MyClass.m_Field"
  • 哪些复杂的方法没有足够的注释?
    Select METHODS Where CyclomaticComplexity > 15 AND PercentageComment < 20

CQL语言还能够用来定义某些原则对每次构建进行检查。如果与原则冲突,用户就能够从报告中知晓。NDepend提供了50多条预先定义的原则,同时还允许用户自定义符合系统要求的原则,例如:

  • 静态字段不能被命名为m_XXX(自定义的命名规范):
    WARN IF Count > 0 IN Select FIELDS Where NameLike "^m_" AND IsStatic
  • 我不想让我的用户界面层直接依赖于DataBase层:
    WARN IF Count > 0 IN Select NAMESPACES Where IsDirectlyUsing "DataLayer" AND NameIs "UILayer"
  • MyAssembly和MyAssembly2的方法不能超过30行代码:
    WARN IF Count > 0 IN Select METHODS OUT OF ASSEMBLIES "MyAssembly1", "MyAssembly2" Where NbLinesOfCode > 30

NDepend可以比较代码库的两个版本。当我们即将发布一个新版本,以及需要进行冒烟测试,和对修改内容进行代码评审时,这一功能特性就格外的行之有效。此处,同样借助了CQL语言以探测版本之间的区别。例如,显示两个版本中被修改过的方法,需要编写:

  • Select METHODS Where CodeWasChanged

最后,NDepend可以作为Visual Studio 2005以及2008的插件,也可以作为Reflector的插件,通过这些工具访问NDepend提供的功能特性。

RB: 若要使用NDepend,应该怎么入门?推荐的学习途径是什么?

PS:首先,需要下载NDepend,然后分析你的代码库。这些操作可以无缝地被执行,因为VisualNDepend的UI与Visual Studio的界面完全相同,甚至于界面效果更好。

一旦分析执行完毕,VisualNDepend的UI就会通过几个面板来显示分析结果。此时,如果用户希望浏览依赖关系或软件度量,或者通过CQL 语言查询代码库,以及比较分析结果等……都需要对此进行选择。无论内容的多少,每个功能特性都会提供一个专门的面板。同时还内嵌了一个“帮助”节,它包含了对 NDepend的入门介绍。一些视频广播还具有链接。它们为用户演示了如何执行每个特定的任务。最后,我们的网站还提供了一些高级文档,例如完整的CQL 规格说明书。

一旦用户掌握了每个功能特性,就能够统一地使用它们完成对代码库的评审与修正。

RB: NDepend能够工作在.NET Framework 3.5下吗?3.0呢?

PS: 可以,新的NDepend 2.6版本的Visual Studio插件可以工作在Visual Studio 2008下。而且,NDepend也能够分析.NET 3.5和3.0的程序集。

RB: NDepend是针对.NET语言的产品;你是否有计划开发针对其他平台的产品?是否有计划增加对动态代码库的分析?

PS: 是的。NDepend采用C#进行编码,但是在我们的代码中只有5%是专门针对于.NET代码分析的。这意味着95%的代码与要分析代码的平台是抽象隔离的。正是基于这种背景,目前就有一家公司octo technology 正在开发能够分析Java代码的NDepend版本。octo technology是一家法国的咨询公司,专注于软件与信息系统的架构设计,它汇聚了大量的Java和.NET专家。Octo的.NET咨询师喜欢使用 NDepend,而Java咨询师也希望能够获得同样的工具。我们决定对此进行合作。

XDepend项目(NDepend的Java版本)的beta版会在2008的第1个季度推出。

RB: 对于初学者而言,使用NDepend进行代码分析看起来非常复杂;你对此有什么好的建议或者指导吗?

PS: 在VisualNDepend的UI中内嵌了一个帮助节,包含了一些入门级介绍以及具有链接的视频广播。在www.ndepend.com/GettingStarted.aspx中可以获得一些大约3分钟长度的视频广播,内容是对NDepend的入门讲解。还有一些视频广播则介绍了在主页上推荐的主要用例场景。若要进一步学习,我们还提供了一些文档,例如完整的 CQL规格说明,对所有度量的描述文档,Scott Hanselman、Stuart Celarier和Patrick Caulwell共同发表的总结文档的PDF:NDepend metric placemats ,同时,在我们网站的documentation部分还提供了更多的内容。此外,我还会定期地更新博客(http://codebetter.com/blogs/patricksmacchia/default.aspx),并在那里阐述了NDepend的高级用法。

RB: 你们是否为软件团队提供培训,使得他们能够快速上手,并熟练地进行运用?

PS: 有时候我们会走访一些订阅了企业许可证以及希望获得特殊培训的客户。即使培训并非我们的主要工作,我们也要持续开展。与用户的直接联系会为我们提供更多的信息。功能特性的完善与用户的反馈是分不开的。

RB: 你认为NDepend最强或者说最好的功能特性是什么?而原因又在于什么?

PS: 这个问题很难回答,事实上,我们大量地使用了NDepend来规范NDepend的编码。我每天都在亲自使用度量去浏览依赖关系,确保体系架构保持清晰。我们拥有超过400条CQL原则,这些原则能够帮助我们持续不变地关注代码质量。我也为NDepend的比较特性所深深地吸引。我通常会使用它去评审发生改变的代码。我相信变化往往就是噩梦的开始。

所谓“一份耕耘,一份收获”,这种方式能够极大地改善我们的开发过程,使得我们能够以一种持续的节奏发布新的版本。更多的内容可以在我们的 发布笔记中找到。

RB: 今天,我们非常感谢Patrick牺牲宝贵的时间,指导我们了解了关于NDepend的知识。

有关NDepend的更多内容可以在NDepend的网站上找到。读者可以通过Patrick的博客了解更多Patrick的信息。

查看英文原文Talking .NET Code Analysis with Patrick Smacchia

[教程].NET Framework 3.5增强特性学习工具包

mikel阅读(810)

微软最近提供了.NET Framework 3.5增强特性学习工具包。该工具包只包含了未来将要发布的新技术的演示文档、Demo、视频演示以及动手实验。

动手实验包含以下主题:

  • ADO.NET Data Services
  • ASP.NET MVC
  • ASP.NET Dynamic Data
  • ADO.NET Entity Framework
  • ASP.NET Ajax History
  • ASP.NET Silverlight Controls

以下是每个实验和练习的简短描述。

介绍ADO.NET Data Services

这个实验突出创建一个数据服务,使用实体框架(Entity Framework)作为他的数据源,并展示了如何使用.NET客户端APIs和ASP.NET AJAX APIs 消费服务。此外你也可以使用服务拦截器增加加验证支持和自定义查询的服务操作。

练习:

  1. 创建和消费ADO.NET data services
  2. 使用ASP.NET AJAX API消费ADO.NET data services
  3. 使用服务操作和拦截器扩展数据服务

开发ASP.NET MVC应用

这个实验展示了建立ASP.NET MVC应用程序的基本原则,核心概念,工作原理以及如何使用。你也会了解到开发应用程序的时候执行单元测试需要什么以及如何做单元测试,如何使用IoC容器扩展ASP.NET framework。

练习:

  1. 建立ASP.NET MVC应用程序
  2. 使用测试驱动开发(TDD)方式开发ASP.NET MVC应用程序
  3. 在ASP.NET MVC中使用IoC容器

介绍ASP.NET Dynamic Data 

在这个实验中,你将学会如何快速创建和定制一个数据驱动的Web应用程序,而不需要编写大量的代码。使用ASP.NET Dynamic Data的功能构建的应用程序为数据库的数据模型提供查看,编辑,过滤和排序操作。

练习:

  1. 创建数据驱动的web应用程序
  2. 定制一个ASP.NET Dynamic Data应用程序

介绍ADO.NET Entity Framework 

在这个实验中,你将学会如何使用ADO.NET Entity Framework工具创建一个实体数据模型和如何使用Entity Framework APIs.

练习:

  1. 创建和消费一个实体数据模型

介绍ASP.NET AJAX History

一个典型的AJAX应用程序面临的一个问题是浏览器的后退按钮不会返回到AJAX的上一步,而是回退整个文档,这不是用户所 期望的。在这个实验中,你将学会如何使用ASP.NET AJAX History特性通过服务器控件或者客户端代码维护浏览历史,使得用户点击浏览器的后退和前进按钮在AJAX的状态之间移动。

练习:

  1. 通过服务端控件为ASP.NET AJAX Web应用程序增加历史功能
  2. 通过AJAX API为ASP.NET AJAX Web应用程序增加历史功能

介绍ASP.NET Silverlight 控件

在这个实验中,你将学会如何使用Silverlight的ASP.NET控件为你的Web应用程序添加 富媒体功能。一方面你将学到可让你的网站整合音频和视频的ASP.NET MediaPlayer控件,另一方面你将学到整合XAML到你的网站的ASP.NET Silverlight通用控件。

练习:

  1. 为Web应用程序添加富媒体功能。
  2. 在ASP.NET应用程序中集成Silverlight内容

学习工具包支持的操作系统是Windows Vista 和Windows XP。需要安装以下应用程序:Microsoft Visual Studio 2008, Microsoft SQL Server 2005 (推荐用Express), Microsoft Office Powerpoint 200 或者PowerPoint Viewer 2007 (用于查看演示文档)和Windows PowerShell 1.0 RTM。

查看英文原文:.NET Framework 3.5 Enhancements Training Kit Available

[代码]更新记录后关闭子窗口并刷新父窗口的JS

mikel阅读(836)

以ASP代码为例,使用一个条件句决定代码执行顺序,你可以将它放在记录更新之后(将转向目标后加上条件参数,例如转向目标为post.asp?action=go)

<% if Request("action")="go" then %>
<script language="JavaScript">
<!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
window.opener.progressWindow.close();
window.close();
}
//-->
</script>
<body bgcolor="#f5f5f3" leftmargin="0" topmargin="0" onLoad="refreshParent()"><%end if%>