Android -- ProgressBar(进度条的使用)
我们在开发程序是经常会需要软件全屏显示、自定义标题(使用按钮等控件)和其他的需求,今天这一讲就是如何控制Android应用程序的窗体显示.
requestWindowFeature可以设置的值有:(具体参考 点击链接查看效果)
1.DEFAULT_FEATURES:系统默认状态,一般不需要指定
// 2.FEATURE_CONTEXT_MENU:启用ContextMenu,默认该项已启用,一般无需指定
// 3.FEATURE_CUSTOM_TITLE:自定义标题。当需要自定义标题时必须指定。如:标题是一个按钮时
// 4.FEATURE_INDETERMINATE_PROGRESS:不确定的进度 圆形的进度条
// 5.FEATURE_LEFT_ICON:标题栏左侧的图标
// 6.FEATURE_NO_TITLE:无标题
// 7.FEATURE_OPTIONS_PANEL:启用“选项面板”功能,默认已启用。
// 8.FEATURE_PROGRESS:进度指示器功能
// 9.FEATURE_RIGHT_ICON:标题栏右侧的图标
2.
3. Java 代码
MyProgressBar
package zyf.test.ProgressBar; import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast; public class MyProgressBar extends Activity implements OnClickListener ,
android.content.DialogInterface.OnClickListener { /** Called when the activity is first created. */
private Button up1 , down1; private Button up2 , down2; private Button roundA , roundB , rectA , rectB; private ProgressBar myProgressBar; private AlertDialog.Builder AlterD , AlterD2; private LayoutInflater layoutInflater; private LinearLayout myLayout; private Button myup , mydown; private ProgressBar mypro; private LayoutInflater layoutInflater2; private LinearLayout myLayout2; private static final int Round_A = 110; private static final int Round_B = 120; private static final int Rect_A = 130; private static final int Rect_B = 140; private static int Tag = 0; @ Override
public void onCreate ( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); SetFeature ( );
FindView ( );
SetListener ( ); // Activity 中的构造方法 --> 设置标题中的进度条的进度。
setProgress ( myProgressBar.getProgress ( ) * 100 );
setSecondaryProgress ( myProgressBar
.getSecondaryProgress ( ) * 100 ); } /**
* 设置标题为水平进度条的形式,并加载布局文件
*/
private void SetFeature ( ) { // 进度指示器的功能
requestWindowFeature ( Window.FEATURE_PROGRESS ); setContentView ( R.layout.main );
setProgressBarVisibility ( true ); } /**
* 为8个按钮设置监听事件
*/
private void SetListener ( ) { // TODO Auto-generated method stub
up1.setOnClickListener ( this );
down1.setOnClickListener ( this );
up2.setOnClickListener ( this );
down2.setOnClickListener ( this );
roundA.setOnClickListener ( this );
roundB.setOnClickListener ( this );
rectA.setOnClickListener ( this );
rectB.setOnClickListener ( this ); } /**
* 找到布局文件中的组件
*/
private void FindView ( ) { // TODO Auto-generated method stub
// 第二行 左边的加号
up1 = ( Button ) findViewById ( R.id.bt1_Up );
// 第二行 左边的减号
down1 = ( Button ) findViewById ( R.id.bt1_Down );
// 第二行 右边的加号
up2 = ( Button ) findViewById ( R.id.bt2_Up );
// 第二行 右边的减号
down2 = ( Button ) findViewById ( R.id.bt2_Down );
// 第二行 中间的水平进度条
myProgressBar = ( ProgressBar ) findViewById ( R.id.progressbar_updown ); // 圆形A按钮
roundA = ( Button ) findViewById ( R.id.bt_RoundA );
// 圆形B按钮
roundB = ( Button ) findViewById ( R.id.bt_RoundB );
// 长血条A按钮
rectA = ( Button ) findViewById ( R.id.bt_RectA );
// 长血条B按钮
rectB = ( Button ) findViewById ( R.id.bt_RectB ); AlterD = new AlertDialog.Builder ( this );
AlterD2 = new AlertDialog.Builder ( this ); } /**
* 按钮的点击事件
*/
@ Override
public void onClick ( View button ) { // TODO Auto-generated method stub SwitchUPorDown ( button );
setProgress ( myProgressBar.getProgress ( ) * 100 );
setSecondaryProgress ( myProgressBar
.getSecondaryProgress ( ) * 100 );
} /**
* 各个按钮的处理事件
*
* @param button
*/
private void SwitchUPorDown ( View button ) { switch ( button.getId ( ) ) {
case R.id.bt1_Up : {
myProgressBar.incrementProgressBy ( 5 );
}
break;
case R.id.bt1_Down : {
myProgressBar.incrementProgressBy ( - 5 );
}
break;
case R.id.bt2_Up : {
myProgressBar.incrementSecondaryProgressBy ( 5 );
}
break;
case R.id.bt2_Down : {
myProgressBar.incrementSecondaryProgressBy ( - 5 );
}
case R.id.bt_RoundA : {
showDialog ( Round_A );
}
break;
case R.id.bt_RoundB : {
showDialog ( Round_B );
}
break;
case R.id.bt_RectA : {
showDialog ( Rect_A );
}
break;
case R.id.bt_RectB : {
showDialog ( Rect_B );
}
break;
case R.id.myView_BT_Up : {
mypro.incrementProgressBy ( 1 ); }
break;
case R.id.myView_BT_Down : {
mypro.incrementProgressBy ( - 1 );
}
break;
default :
break;
}
} /**
* showDialog 的回调方法 ,根据传递过来的值进行分别的显示信息
*/
@ Override
protected Dialog onCreateDialog ( int id ) { // TODO Auto-generated method stub
switch ( id ) {
case Round_A : {
ProgressDialog mypDialog = new ProgressDialog (
this );
mypDialog.setProgressStyle ( ProgressDialog.STYLE_SPINNER );
mypDialog.setTitle ( "Android" );
mypDialog.setMessage ( getResources ( )
.getString ( R.string.first ) );
mypDialog.setIcon ( R.drawable.android );
mypDialog.setIndeterminate ( false );
mypDialog.setCancelable ( true );
return mypDialog;
}
case Round_B : {
ProgressDialog mypDialog = new ProgressDialog (
this );
mypDialog.setProgressStyle ( ProgressDialog.STYLE_SPINNER );
mypDialog.setTitle ( "Google" );
mypDialog.setMessage ( getResources ( )
.getString ( R.string.second ) );
mypDialog.setIcon ( R.drawable.android );
mypDialog.setButton ( "Google" ,
this );
mypDialog.setIndeterminate ( false );
mypDialog.setCancelable ( true );
return mypDialog;
} case Rect_A : {
ProgressDialog mypDialog = new ProgressDialog (
this );
mypDialog.setProgressStyle ( ProgressDialog.STYLE_HORIZONTAL );
mypDialog.setTitle ( getResources ( )
.getString ( R.string.me ) );
mypDialog.setMessage ( getResources ( )
.getString ( R.string.third ) );
mypDialog.setIcon ( R.drawable.android );
mypDialog.setProgress ( 59 );
mypDialog.setIndeterminate ( true );
mypDialog.setCancelable ( true );
return mypDialog;
} case Rect_B : {
ProgressDialog mypDialog = new ProgressDialog (
this );
mypDialog.setProgressStyle ( ProgressDialog.STYLE_HORIZONTAL );
mypDialog.setTitle ( getResources ( )
.getString ( R.string.HellSun ) );
mypDialog.setMessage ( getResources ( )
.getString ( R.string.fourth ) );
mypDialog.setIcon ( R.drawable.android );
mypDialog.setProgress ( 59 );
mypDialog.setButton ( getResources ( )
.getString ( R.string.HellSun ) ,
this );
mypDialog.setIndeterminate ( true );
mypDialog.setCancelable ( true );
return mypDialog;
}
}
return null;
} /************************************************************************************************************/ /**
* 对话框中按钮的处理事件
*/
@ SuppressWarnings ( "static-access" )
@ Override
public void onClick ( DialogInterface dialog , int which ) { // TODO Auto-generated method stub
if (which == dialog.BUTTON1) {
Toast.makeText ( this ,
"Button1" ,
Toast.LENGTH_LONG )
.show ( );
}
} /**
* 创建选项菜单 圆形 ,长方形 ,以及标题栏圆形进度条
*/
@ Override
public boolean onCreateOptionsMenu ( Menu menu ) { // TODO Auto-generated method stub
menu.add ( 0 , 1 , 1 , "Round" ).setIcon (
R.drawable.ma );
menu.add ( 0 , 2 , 2 , "Rect" ).setIcon (
R.drawable.mb );
;
menu.add ( 0 , 3 , 3 , "Title" ).setIcon (
R.drawable.mc );
return super.onCreateOptionsMenu ( menu );
} /**
* 选项菜单点击事件的处理
*/
@ SuppressWarnings ( "static-access" )
@ Override
public boolean onOptionsItemSelected ( MenuItem item ) { // TODO Auto-generated method stub
switch ( item.getItemId ( ) ) {
case 1 : {
layoutInflater2 = ( LayoutInflater ) getSystemService ( this.LAYOUT_INFLATER_SERVICE );
myLayout2 = ( LinearLayout ) layoutInflater2
.inflate ( R.layout.roundprogress ,
null );
AlterD2.setTitle ( getResources ( )
.getString ( R.string.RoundO ) );
AlterD2.setIcon ( R.drawable.ma );
AlterD2.setMessage ( getResources ( )
.getString ( R.string.ADDView ) );
AlterD2.setView ( myLayout2 );
AlterD2.show ( );
}
break;
case 2 : {
layoutInflater = ( LayoutInflater ) getSystemService ( this.LAYOUT_INFLATER_SERVICE );
myLayout = ( LinearLayout ) layoutInflater
.inflate ( R.layout.myview ,
null );
myup = ( Button ) myLayout.findViewById ( R.id.myView_BT_Up );
mydown = ( Button ) myLayout.findViewById ( R.id.myView_BT_Down );
mypro = ( ProgressBar ) myLayout
.findViewById ( R.id.myView_ProgressBar );
myup.setOnClickListener ( this );
mydown.setOnClickListener ( this );
mypro.setProgress ( Tag );
AlterD.setTitle ( getResources ( )
.getString ( R.string.RectO ) );
AlterD.setIcon ( R.drawable.mb );
AlterD.setMessage ( getResources ( )
.getString ( R.string.ADDView ) );
AlterD.setView ( myLayout );
AlterD.setPositiveButton ( "OK" ,
new DialogInterface.OnClickListener ( ) { @ Override
public void onClick ( DialogInterface dialog ,
int which ) { // TODO Auto-generated method stub
MyProgressBar.Tag = mypro.getProgress ( );
}
} );
AlterD.show ( );
}
break;
case 3 : {
Intent startIntent = new Intent ( );
startIntent.setClass ( MyProgressBar.this ,
MyActivity.class );
startActivity ( startIntent );
}
break;
default :
break;
}
return super.onOptionsItemSelected ( item );
} }
MyActivity
package zyf.test.ProgressBar; import android.app.Activity;
import android.os.Bundle;
import android.view.Window; public class MyActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.second);
setProgressBarIndeterminateVisibility(true);
} }
Layout
main.xml
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget40"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/back"
android:orientation="vertical"
android:stretchColumns="1" > <TableRow
android:id="@+id/widget41"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <LinearLayout
android:id="@+id/widget42"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" > <ProgressBar
android:id="@+id/widget43"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" >
</ProgressBar>
</LinearLayout>
</TableRow> <TableRow
android:id="@+id/widget44"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" > <LinearLayout
android:id="@+id/widget45"
android:layout_width="fill_parent"
android:layout_height="fill_parent" > <Button
android:id="@+id/bt1_Down"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="-" >
</Button> <Button
android:id="@+id/bt1_Up"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="+" >
</Button> <ProgressBar
android:id="@+id/progressbar_updown"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:max="100"
android:progress="50"
android:secondaryProgress="70" >
</ProgressBar> <Button
android:id="@+id/bt2_Down"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="-" >
</Button> <Button
android:id="@+id/bt2_Up"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:text="+" >
</Button>
</LinearLayout>
</TableRow> <TableRow
android:layout_width="fill_parent"
android:layout_height="20dp"
android:orientation="horizontal" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="大小样式" >
</TextView>
</TableRow> <LinearLayout
android:id="@+id/widget158"
android:layout_width="wrap_content"
android:layout_height="328px"
android:orientation="vertical" > <TextView
android:id="@+id/widget195"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="超大号" >
</TextView> <ProgressBar
android:id="@+id/widget196"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar> <TextView
android:id="@+id/widget197"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="普通号" >
</TextView> <ProgressBar
android:id="@+id/widget198"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar> <TextView
android:id="@+id/widget107"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小号" >
</TextView> <ProgressBar
android:id="@+id/widget108"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar> <TextView
android:id="@+id/widget109"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title超小号" >
</TextView> <ProgressBar
android:id="@+id/widget110"
style="?android:attr/progressBarStyleSmallTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ProgressBar> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="对话框进度条" >
</TextView> <LinearLayout
android:id="@+id/widget324"
android:layout_width="319px"
android:layout_height="wrap_content"
android:background="@drawable/bt_group_back" > <Button
android:id="@+id/bt_RoundA"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="圆形A" >
</Button> <Button
android:id="@+id/bt_RoundB"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="圆形B" >
</Button> <Button
android:id="@+id/bt_RectA"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="长血条A" >
</Button> <Button
android:id="@+id/bt_RectB"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="长血条B" >
</Button>
</LinearLayout>
</LinearLayout> </TableLayout>
myview.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" > <Button
android:id="@+id/myView_BT_Down"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="-" >
</Button> <ProgressBar
android:id="@+id/myView_ProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="178dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:progress="57" >
</ProgressBar> <Button
android:id="@+id/myView_BT_Up"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="+" >
</Button> </LinearLayout>
roundprogress.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" > <LinearLayout
android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout> <ProgressBar
android:id="@+id/myView_ProgressBar2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:progress="57" >
</ProgressBar> </LinearLayout>
second.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/back">
</LinearLayout>
widgetlayout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/widget"
android:layout_height="74dp"
android:layout_width="296dp">
<Button
android:layout_height="wrap_content"
android:text="-"
android:layout_gravity="center_vertical"
android:layout_width="50dp"
android:id="@+id/widget_BT_Down"
android:layout_marginLeft="10dp">
</Button>
<ProgressBar
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="178dp"
android:id="@+id/widget_ProgressBar">
</ProgressBar>
<Button
android:layout_height="wrap_content"
android:text="+"
android:layout_gravity="center_vertical"
android:layout_width="50dp"
android:id="@+id/widget_BT_Up">
</Button>
</LinearLayout>
string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello World, MyProgressBar!</string>
<string name="app_name">MyProgressBar Study</string>
<string name="first">第一个普通圆形ProgressDialog测试</string>
<string name="second">第二个圆形ProgressDialog,带有按钮的。测试</string>
<string name="me">地狱怒兽</string>
<string name="third">第一个长方形ProgressDialog 测试</string>
<string name="HellSun">地狱曙光</string>
<string name="fourth">第二个长方形ProgressDialog ,带有按钮的。测试</string>
<string name="RoundO">圆形进度条</string>
<string name="ADDView">测试View加入进度条</string>
<string name="RectO">长形进度条</string>
</resources>
--------------------------------------------------------------------------------------------------------------------------------------------
可以自动增加和减少的水平进度条
Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <ProgressBar
android:id="@+id/porb"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:secondaryProgress="70"
android:text="progress2" /> </LinearLayout>
Java
package com.progressbar; import android.app.Activity;
import android.os.Bundle;
import android.widget.ProgressBar; // 使用Runnable接口
public class MainActivity extends Activity implements Runnable { private Thread th; //声明一条线程 private ProgressBar pb; //声明一个进度条对象 private boolean stateChage; //标识进度值最大最小的状态 @ Override
public void onCreate ( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState );
setContentView ( R.layout.main );
//实例进度条对象
pb = ( ProgressBar ) findViewById ( R.id.porb );
th = new Thread ( this );//实例线程对象
th.start ( );//启动线程
} @ Override
public void run ( ) {//实现Runnable接口抽象函数 while ( true ) {
int current = pb.getProgress ( );//得到当前进度值
int currentMax = pb.getMax ( );//得到进度条的最大进度值
int secCurrent = pb.getSecondaryProgress ( );//得到底层当前进度值
//以下代码实现进度值越来越大,越来越小的一个动态效果
if (stateChage == false) {
if (current >= currentMax) {
stateChage = true;
}
else {
//设置进度值
pb.setProgress ( current + 1 );
//设置底层进度值
pb.setSecondaryProgress ( current + 1 );
}
}
else {
if (current <= 0) {
stateChage = false;
}
else {
pb.setProgress ( current - 1 );
pb.setSecondaryProgress ( current - 1 );
}
}
try {
Thread.sleep ( 50 );
}
catch ( InterruptedException e ) {
// TODO Auto-generated catch block
e.printStackTrace ( );
}
}
}
}
Android -- ProgressBar(进度条的使用)的更多相关文章
- android ProgressBar 进度条的进度两端是圆角的方法
转自 http://www.jianshu.com/p/6e7ea842d5ce 另外工作原理可以参考http://blog.csdn.net/lan603168/article/details/44 ...
- Android ProgressBar 进度条荧光效果
http://blog.csdn.net/ywtcy/article/details/7878289 这段时间做项目,产品需求,进度条要做一个荧光效果,类似于Android4.0 浏览器中进度条那种样 ...
- Android——ProgressBar(进度条)
参考资料来源于菜鸟教程--学的不仅是技术,更是梦想! 学习! 1.常用属性讲解与基础实例 从官方文档,我们看到了这样一个类关系图: ProgressBar继承与View类,直接子类有AbsSeekBa ...
- Android学习笔记- ProgressBar(进度条)
本节引言: 本节给大家带来的是Android基本UI控件中的ProgressBar(进度条),ProgressBar的应用场景很多,比如 用户登录时,后台在发请求,以及等待服务器返回信息,这个时候会用 ...
- Android 设置进度条背景
Android 设置进度条背景 直接上代码 <ProgressBar android:id="@+id/progressBar" android:layout_width=& ...
- android 自定义进度条颜色
android 自定义进度条颜色 先看图 基于产品经理各种自定义需求,经过查阅了解,下面是自己对Android自定义进度条的学习过程! 这个没法了只能看源码了,还好下载了源码, sources\b ...
- Android之进度条2
我之前有写过一篇“Android之进度条1”,那个是条形的进度条(显示数字进度),这次实现圆形进度条. 点击查看Android之进度条1:http://www.cnblogs.com/caidupin ...
- android的进度条使用
android的进度条 1.实现的效果 2.布局代码 先写一个my_browser.xml文件 存放WebView <?xml version="1.0" encoding= ...
- android多线程进度条
多线程实现更新android进度条. 实例教程,详细信息我已经注释 android多线程进度条 01package com.shougao.hello; 02 03import android ...
随机推荐
- 一个简单的Promise 实现
用了这么长时间的promise,也看了很多关于promise 的文章博客,对promise 算是些了解.但是要更深的理解promise,最好的办法还是自己实现一个. 我大概清楚promise 是对异步 ...
- visual studio2010复制粘贴源代码到Word时乱码问题 分类: C# 2014-11-28 09:25 687人阅读 评论(0) 收藏
问题描述: visual studio2010 拷贝源代码的时候,在windows自带的写字板和word2010上,粘贴的时候中文字符都会变成乱码. 如: "该用户已经被成功添加" ...
- js 控制展开折叠 div html dom
js 控制展开折叠 div html dom <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ...
- PHP5中使用PDO连接数据库的方法
PDO(PHP Data Object) 是PHP 中加入的东西,是PHP 5新加入的一个重大功能,因为在PHP 5以前的php4/php3都是一堆的数据库扩展来跟各个数据库的连接和处理,php_my ...
- 连接SQL Server执行SQL语句
public static DataTable GetData() { string Connect = ConfigurationManager.AppSettings["Connecti ...
- PMP 第七章 项目成本管理
估算成本 制定预算 控制成本 1.成本管理计划的内容和目的是什么? 包括对成本进行估算 预算和控制的各过程,从而确保项目在批准的预算内完工. 2.直接成本.间接成本.可变成本.固定成本.质量成 ...
- loj 1037(状压dp)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25914 思路:dp[state]表示当前状态下要消耗的最小的sho ...
- lr中switch的应用
Action() { char *time; int i,j,length; time=lr_eval_string("{testtime}"); lr_error_message ...
- Angular JS 学习之简介
1.Angular JS是一个JavaScript框架,它是一个以JavaScript编写的库,它可以通过<script>标签添加到HTML页面: <script src=" ...
- jquery笔记(操作HTML)
获取: $("selector").text(): 获取元素里面的文本 $("selector").html(): 获取元素里面的代码标签 $("se ...