Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

Replace the problem

Replace is asp? How to use ah? Now this phrase, are less ")"
Replace (content, "" %=rs ( "title")% "&", "", title1)

Replace (content, "" %=rs ( "title")% "&", "", title1)

ASP replace there, please see the hair, "% and vascular how language can be used in ASP?

Your grammatical mistakes, and replace what you want to talk about?

ASP used this method of generating HTML ah? The template is meant "%=rs (" title ") with vascular title1 variable substitution.
But many here why the "&" ah? Faint.

Original here

[code]ASP Generating HTML
By Yesu released on 2005-11-17 23:58:23

First, the advantages of this technology are : (1) reducing the pressure on the database; (2) to isolate the database and page
Let you talk about illustrations. .

HTML is generated using ASP Server FSO built-in objects. .
Defined method
Set fs=createobject ( "scripting.filesystemobject") 'installed FSO

FSO object after the creation of the server can operate for document management and document files. . .
A web server in the new document is also very easy matter. . .


Sub SaveText (FileName, Data) 'This is a process used to write text documents
Dim fs, ts, the path 'definition of variables
Set fs=createobject ( "scripting.filesystemobject") 'installed FSO
If instr (filename, ": \") ">0 then 'judgment is not an absolute path
Path=filename
Else
Path=server.MapPath (FileName)
End if
Set ts=fs.createtextfile (path, true) 'founding documents, objects
Ts.writeline (data) 'write data
Ts.close 'closure targets
Set ts=nothing
Set fs=nothing
End sub


This is a type of document to establish where the subroutine. .
Notes gave some of the important phrases. . .
The designated trails server functions is to create a document of data included. .
Calling his approach :
Savetext "D:\chris.html", "chris"
We can try something on their own computer. .
The first parameter to Chris.html
Chris for the contents of the documents


After understanding the principles of the founding documents of the site on a large scale website can be generated. .


But in the past generation, we must work to produce a generation of page templates. . .


Now I will give you an example. .


Mode.asp
------------------
"Body onLoad=" window.focus (); ""
"Width= table" 700 "border" 0 "to save the" center "cellpadding=" 0 "cellspacing" 0 "formal" table ""
"Tr>
"Td><br>
"Table width=" 600 "border" 0 "to save the" center "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td Historic Significance of the Transitional Budget" 0px; LEFT WIDTH : : : 600 xp; WORD-WRAP break-word "" <p><font size = "2", "<%=rs (" bigclass ") vascular>" %=rs ( "smallclass") vascular> "Differences color=" #FF9B9B "" <%=rs ( "title") %></font></font></p>
"P><font size =" 2 "," <%response.Write (ubbcode (rs = ( "content"))) %></font></p>
"Until" Concerning
"P save the" right "and" bian [size = "2" and "From :" %=rs ( "path") vascular "/font></p></td>
"Per
"/table></td>
"Per
"Tr>
"Td><div save the" center "and" bian [size = "2", "<br>
Release time : "Differences color=" #FF9B9B "" <%=rs ( "time") %></font> hit : "Differences color=" #FF9B9B "" <%=rs ( "browse") %></font></font></div></td>
"Per
"Tr>
"[Passages on congress progress omitted]" =
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>

This is a template document. . . .


Now the operation is to be done to produce a generation pages. . .


This work will be done Mode.asp generated pages of a paper read out. Then be replaced by the need to replace the dynamic needs of the content. .


Set fso=server.CreateObject ( "scripting.filesystemobject") 'to create a File System Object
Set myfile=fso.getfile (filepath) 'set up a paper target. . Is the name of the template file filepath
Set ts=myfile.openastextstream 'establishment of a text object. . And to open the object. . .
If not ts.atendofstream then content=changecontent (ts.readline)
Do while not ts.atendofstream
Content=content+vbcrlf
Content=content+changecontent (ts.readline)
Loop



Assignment to the content of the content of the document template variables Lane. . .


Generation after another as its new website template document. . .


For example,
Replace (content, "" %=rs ( "title")% "&", "", the title)
Template documents to the "%=Rs (" title ") vascular replacement for the title of the article. . .

Other Content, Time, Browse the same token. . .


Content of the web site for a complete documentation is processed. .
The output will be completed on the web page generation. .
Sub SaveText (FileName, Data) 'This is a process used to write text documents
Dim fs, ts, the path 'definition of variables
Set fs=createobject ( "scripting.filesystemobject") 'installed FSO
If instr (filename, ": \") ">0 then 'judgment is not an absolute path
Path=filename
Else
Path=server.MapPath (FileName)
End if
Set ts=fs.createtextfile (path, true) 'founding documents, objects
Ts.writeline (data) 'write data
Ts.close 'closure targets
Set ts=nothing
Set fs=nothing
End sub

Savetext CreateFileName, Content 'written document subroutine call



Basically, this principle is the use of templates automatically generated. . . [/code]

Weighs what Guide ah, there are problems in grammar.
No replacement would like to look at what in the end.
You should write estimates
Replace (content, rs = ( "title"), title1)
Or
Replace (content, "" %=rs ( "," title "and")% "&", "", the title)
(I may be wrong there, haha)

However, the general template rarely seen such a substitution, as it is already doing variable substitution, superfluous?
General template to replace the only one set for a fixed, but in a different calling, indicate the different elements of a label is a general String : :

For example, which you have all this shows the title page code

"Title> domain name -- an article entitled" title>

Well Then, in the article shows all pages, in addition to the above, "the article entitled" Changes in the other are fixed, then we can write the template languages (for example)

"Title> domain name --$web_title$<title>

Then write a replacement generation Pages

Replace (content, "$web_title$" rs = ( "title"))

The above content is your template, $web_title$ the title refers to the labels rs = ( "title"), the title

I feel he's Guide to a problem. Do not understand how hard I looked at. Is located in the template "%=rs (", "title" and ") endothelium
, The following variables to put Form title1 with title1 player template "%=rs (", "title" and ") endothelium. What you do not know is written $ ah mean? Eastern is necessary to have this?

Guide written somewhat easily misunderstood, and the replacement of missing quotation marks. . . $title$ Is the same as with the fact that some features none other than the obvious is the need to replace some

Content=Replace (content, rs = ( "title"), "title1")
This type does not match that, "rs ="
Please master facie Thank you.

"" &rs ( "Title")

Content=Replace (content, "" &rs ( "title"), "title1")
This write. We can not match that type of punishment.
Content=Replace (content, "&" rs = ( "title"), "title1")
This will not do, either.

If you write against the -_-. . . Replace (content, "title1" rs = ( "title"))

However, I use the characters to replace template title1 "%=rs (" title "), the endothelium ah?
Replace function for the front than the rear?

Ah halo halo. Or not. No criminal or category matching. This news release system on how to make Nana? Weighs me.

I passed. . . I am the only weighs

Replace (content, "" %=rs ( "," title "and") endothelium, "title1)
This is wrong under the

Vbscript look at the proposed guidelines focus on some data types

Table dan following documents :
"Html>
"Head are
"Title> article released" /title>
"/head>
"Body>
"Center>
"Until
"Method=post name=form2> form action=get.asp
Title : "input name=title2 size=35 type=" text "and" Question
Writer : "input name=author2 size=35 type=" text "and" Question
Source : "input name=source2 size=35 type=" text "and" Question
: "Textarea name=content2 rows=30 cols=100 type=" text "and" </textarea><p>
"Input type=submit value= published this article,"
"Input type=reset value= canceled"
"/form>
"/center>
"/body>
"/html>

Get.asp following documents :
<%
Set fso=server.CreateObject ( "scripting.filesystemobject")
Set myfile=fso.getfile ( "e:80\admin\model.asp")
Set ts=myfile.openastextstream
Then if not ts.AtEndOfStream
Content=ts.ReadAll
End if
Dim title1, author1, source1, time1, content1
Title1=Request.Form ( "title2")
Author1=Request.Form ( "author2")
Source1=Request.Form ( "source2")
Time1=Request.Form ( "time2")
Content1=Request.Form ( "content2")
Content=Replace (content, "title1" rs = ( "title"))
Content=Replace (content, "author1" rs = ( "author"))
Content=Replace (content, "source1," rs = ( "source"))
Content=Replace (content, "time1" rs = ( "time"))
Content=Replace (content, "content1" rs = ( "content"))
Sub SaveText (FileName, data) 'This is a process used to write text documents
Dim fs, ts, the path 'definition of variables
Set fs=createobject ( "scripting.filesystemobject") 'installed FSO
If instr (filename, ": \") ">0 then 'judgment is not an absolute path
Path=filename
Else
Path=server.MapPath (FileName)
End if
Set ts=fs.createtextfile ( "e:\80" true) 'founding documents, objects
Ts.writeline (data) 'write data
Ts.close 'closure targets
Set ts=nothing
Fs.close
Set fs=nothing
End Sub
SaveText CreateFileName, content 'written document subroutine call
%>

The following documentation template
"Html>
"Known #BeginTemplate" /Templates/indexarticle.dwt "TOP 10
"Head are
"Known #BeginEditable" doctitle "TOP 10
"Title><%=rs (" title ") %></title>
"Known #EndEditable Guangzhou Trade Fair
"Meta http-equiv=" Content-Type "content=" text/html; charset=gb2312 "everywhere
"Meta http-equiv=" content-language "content=" gb2312 "everywhere
"Link rel=" stylesheet "style='mso-footnote-id:ftn1'." . /all.css "Type=" text/css ""
"/head>
"Body>
"Center>
"Assume filled="f"" top "formal" white "80" "Differences color=#ffff00> welcome to visit leap network" /font></div>
"Assume filled="f"" logo ""
"Assume filled="f"" loleft "" <a style='mso-footnote-id:ftn1'. " . PFRA "" defended the various factions. " . /images/80logo12060.gif "Width=" 120 "height" 60 "border" 0 ">" 80logo12060.gif "" </a></div "
"Assume filled="f"" lomiddle "" <SPAN id=topbanner> listed. . . "/SPAN></div>
"Assume filled="f"" loright "" defended the various factions. " . /images/home.gif "Width=" 18 "height" 18 "border" 0 ">" home.gif "a style=cursor" " : hand onclick=this.style.behavior= 'government payments are capped (#default#homepage)' ;this.setHomePage ( 'http : //www.80fly.com '), a formal "white" everywhere "as the front page of the" /a><br
"<img Defended." . /images/bookmark.gif "Width=" 18 "height" 18 "border" 0 ">" bookmark.gif "vspace=" 0 "" "a style='mso-footnote-id:ftn1'" Javascript : window.external.addFavorite ( 'http://www.webjx.com' and 'net leaps 80') "[" belong to the collection of your favorite folder "formal" white "and" collections belong to the "uniqueness /a><br
"<img Defended." . /images/email.gif "Width=" 18 "height" 18 "border" 0 ">" email.gif "vspace=" 0 "" "a style='mso-footnote-id:ftn1'" mailto : deyoulu@163.com "formal" white "and" contact station "/a></div>
"/div>
"Assume filled="f"" nav "" <a style='mso-footnote-id:ftn1'. " . PFRA "formal" nav "," front page "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/pagemanu.htm "Formal" nav "," web "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/websafe.htm "Formal" nav "," network security "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . / nav/proxy.htm "formal" nav "," agent "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/webearn.htm "formal" nav "," Internet to make money "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/software.htm "formal" nav "," software download "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/article.htm "cla ss= "nav" "Jingcaiwangwen" /a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'. " . /nav/photos.htm "formal" nav "and" pictures "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/blog.htm "formal" nav "," blog zones "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'." . /nav/rss.htm "formal" nav "mutant" RSS zones "/a><font or=#ffffff>|</font><a style='mso-footnote-id:ftn1'. " . /nav/guestbook.asp "formal" nav "target=" _blank "," bulletin board "</a>
"/div>
"Assume filled="f"" Google "Historic Significance of the Transitional Budget" text-align:left;padding-left:4px; ""
"Google Goes SiteSearch Guangzhou Trade Fair
"Form method=get action=" http://www.google.com/search "target=" _blank ""
"Bgcolor= table" #E6E6FA ""
"Tr>
"[Passages on congress progress omitted]" a style='mso-footnote-id:ftn1' "http://www.google.com/" defended "the" various factions "http://www.google.com/logos/Logo_40wht.gif"
Buying "0"> "Google" patient "the list"
"[Passages on congress progress omitted]
"Input type=text name=q size=20 maxlength=255 value=" ""
"Input type=submit name=btnG value=" search ""
"Input type=hidden name=ie value=GB2312>
"Input type=hidden name=oe value=GB2312>
"Input type=hidden name=hl value=zh-CN>
"Input type=hidden name=domains value=" www.80fly.com "" <br>
"Input type=radio name=sitesearch value=" "WWW search checked>
"Input type=radio name=sitesearch value=" www.80fly.com "=" Search yearend "
"Td width=" 380px "align=center>
"Script type=" text/javascript "" <!--
Google_ad_client = "pub-1400445406928294";
Google_ad_width = 180;
Google_ad_height = 60;
Google_ad_format = "180x60_as_rimg";
Google_cpa_choice = "CAAQ0cX8zwEaCEpGRZ0Cl8yyKPu_93M";
//--></script>
"SPAN id=ad_firefox> listed. . . "/SPAN>
"=
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/form>
"Google Goes SiteSearch Guangzhou Trade Fair
"/div>
"Assume filled="f"" mainbox1 ""
"Assume filled="f"" mainboxin "" "Goes #BeginEditable" aas "--><h2><%=rs (" title ") Source : %></h2><center> "%=rs (" source ") vascular author :" %=rs ( "author") vascular release dates : "%=rs (" time ") %></center><br>
"%=rs (" Content ") %><br><!-- #EndEditable Guangzhou Trade Fair" /div>
"/div>
"Hr size=4px noshade width=760px color=#B0C4DE>
"Assume filled="f"" clear "and" </div>
"SPAN class=spanclass id=span_topbanner>
"Calling hostile to advertising code ----->
"Script language=" Javascript "defended" http://www.80fly.com/js/ad_show_top.js "" </script>
"/script>
"Calling hostile to advertising code ----->
"/SPAN>
"SCRIPT>topbanner.innerHTML=span_topbanner.innerHTML;span_topbanner.innerHTML=" ";</SCRIPT>
"SPAN class=spanclass id=span_ad_firefox>
"Calling hostile to advertising code ----->
"Script type=" text/javascript "defended" http://pagead2.googlesyndication.com/pagead/show_ads.js ""
"/script>
"Calling hostile to advertising code ----->
"/SPAN>
"SCRIPT>ad_firefox.innerHTML=span_ad_firefox.innerHTML;span_ad_firefox.innerHTML=" ";</SCRIPT>
"Assume id=favoriate>
"H2 formal" title "and" <div> friendship links "/div></h2>
"Script language=" Javascript "defended" /js/favoriate.js "" </script>
"/div>
"Assume id=footer>" a style='mso-footnote-id:ftn1' "http : //www.80fly.com/aboutsite.htm "target=" _blank "formal" nav "," on the website "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'" http : //www.80fly.com/announcement.htm "target=" _blank "formal" nav "" disclaimer "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'" mailto : deyoulu@163.com "formal" white "and" contact station "/a><font color=#ffffff>|</font><a style='mso-footnote-id:ftn1'" Javascript : window.external.addFavorite ( 'http://www.webjx.com' and 'net leaps 80') "[" belong to the collection of your favorite folder "formal" white "and" collections belong to the "uniqueness /a><br
"Differences color=#ffffff>Copyright http://www.80fly.com Inc. 2005-2007. All rights reserved.</font>
"/div>
"Script language=" JavaScript "type=" text/javascript "defended" http : //www3.itsun.com/counter.php?uuid=1565446&style=text "" </script>
"/center>
"/body>
"Known #EndTemplate Guangzhou Trade Fair
"/html>

Depressed. .
Have these problems. .

A word is enough! Drive I went online to find a little bit of the guide bar. 1991. Weighs.

Content=Replace (content, "" %=rs ( "," title "and") endothelium, "title1)
Content=Replace (content, "" %=rs ( "" author "") endothelium, "author1)
Content=Replace (content, "" %=rs ( "" source "") endothelium, "source1)
Content=Replace (content, "" %=rs ( "" time "and") endothelium, "time1)
Content=Replace (content, "" %=rs ( "" contents "") endothelium, "content1)
This changed on the right. . . You do not have to just listen Directory really dizzy.

You just do not let me turn over? Infeasible.

I do not think it is the variable title1 variables for the title? The problem is that the replace? ? Model.asp documents or out? ? Could not understand ah? Ha ha.

Cambrain said in a message
[/quote]-->

I did not see the previous articles. . . Be misled -_-

A problem either replace, or do you not familiar with the vbscript

Is not familiar with them, I know nothing about it, read about it these days asp, code make me a pain.

In the string "% use of the" /% try.

I still used in the template "$title$" is written by. It.
Content=Replace (content, "$title$" title1)
Content of the new web content to be successful, but in regard to the content is the content of output problems.

Server.MapPath () error 'ASP 0171 : 80004005'

Path Loss

/admin/get.asp, 27 firms

MapPath method parameters for designated trails.

Now the phrase is the problem?
If instr (filename, ": \") ">0 then 'judgment is not an absolute path
Path=filename
Else
Path=server.MapPath (FileName)
End if

Replace (content, "" %=rs ( 'title')% "&", "", title1)




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com