当前位置: 首页 > news >正文

百度站点四川省查询建设人员注册证书网站

百度站点,四川省查询建设人员注册证书网站,网站制作网站优化,免费的黄页推广软件哪个好有时候我们需要实现一个功能。不过这个功能用我们传统的Java代码实现起来会有一些困难#xff0c;这时我们可以尝试利用Shell命令来实现。你可以按照下面的代码模块来进行你想要实现的Shell命令(注#xff1a;也不是所有的Shell命令都能用Java代码来实现)。public class Main…有时候我们需要实现一个功能。不过这个功能用我们传统的Java代码实现起来会有一些困难这时我们可以尝试利用Shell命令来实现。你可以按照下面的代码模块来进行你想要实现的Shell命令(注也不是所有的Shell命令都能用Java代码来实现)。public class MainActivity extends Activity {private final String TAG ---MainActivity---;public final String SHELL_0 busybox ps;public final String SHELL_1 su;public final String SHELL_2 cd mnt/shell/emulated/0/.ZFSafeFS;public final String SHELL_3 busybox mount .a1.img ./.abc;public final String SHELL_4 busybox umount ./.abc;public final String EXECUTE_SHELL SHELL_0;Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Button sendButton (Button) findViewById(R.id.send_btn);Button suButton (Button) findViewById(R.id.su_button);Button cdButton (Button) findViewById(R.id.alert_path_button);Button mountButton (Button) findViewById(R.id.mount_button);Button umountButton (Button) findViewById(R.id.umount_button);suButton.setText(SHELL_1);cdButton.setText(SHELL_2);mountButton.setText(SHELL_3);umountButton.setText(SHELL_4);sendButton.setOnClickListener(viewOnClickListener);suButton.setOnClickListener(viewOnClickListener);cdButton.setOnClickListener(viewOnClickListener);mountButton.setOnClickListener(viewOnClickListener);umountButton.setOnClickListener(viewOnClickListener);handleShell(EXECUTE_SHELL);}private void handleShell(String shell) {TextView textView (TextView) findViewById(R.id.textview);Process p null;try {p Runtime.getRuntime().exec(shell);if (p null) {textView.setText(p null);} else {BufferedReader bufferedReader new BufferedReader(new InputStreamReader(p.getInputStream()));int read 0;char[] buffer new char[4096];StringBuffer output new StringBuffer();Log.i(TAG, read read);Log.i(TAG, output output);while((read bufferedReader.read(buffer)) 0) {output.append(buffer, 0, read);}bufferedReader.close();String string String.copyValueOf(buffer);Log.i(TAG, string string);textView.setText(result:\n string);}} catch (IOException e) {textView.setText(e e);e.printStackTrace();}}private OnClickListener viewOnClickListener new OnClickListener() {Overridepublic void onClick(View v) {switch (v.getId()) {case R.id.su_button:handleShell(SHELL_1);break;case R.id.alert_path_button:handleShell(SHELL_2);break;case R.id.mount_button:handleShell(SHELL_3);break;case R.id.umount_button:handleShell(SHELL_4);break;default:break;}}};}
http://www.pierceye.com/news/177069/

相关文章:

  • 揭阳有哪家网站制作公司wordpress数据库备份恢复
  • 站长工具友链查询中国网站建设公司图片
  • 做原型的素材网站国内wordpress主题商
  • 合肥的电商网站设计wordpress 相册 链接
  • 试玩平台网站怎么做网站建设推荐中企动力
  • 衡水做网站建设台州网站建设选浙江华企
  • 某集团网站建设规划书用flash做的经典网站
  • 企业网站用什么做一个空间怎么放两个网站吗
  • 58同城长沙回收网站建设长春seo推广
  • 景区网站建设的意义女生学计算机应用技术可以做什么
  • 做律师网站的公司天津公司网站制作
  • 上海建设摩托车官方网站招聘网站数建设
  • 自己制作一个网站需要什么软件安吉网站制作
  • 如何设计服装网站首页网站建设比较好的公司
  • 微信网站的链接标志图片如何做公众号如何创建
  • 建站公司建的网站能改动吗怎样设置默认网站
  • 高并发电商网站开发辽宁省朝阳市做网站
  • 公司做网站有用吗合肥企业快速建站
  • 因脉网站建设公司怎么呀韩国网站开发建设技术特点
  • 网站备案 个人 单位安徽网站建设推广
  • 黔江网站制作网站招标建设
  • 网站注册公司目前最好的引流方法
  • 小米wifi设置网址入口网站通信工程建设网站
  • 深圳专业网站建在线做插画的网站
  • 站长之家网站查询怎么样创建自己的小程序
  • 站酷海报设计图片网站备份怎么做
  • 做网站挣钱么云市场 wordpress
  • 网站域名管理规范seo专员是什么
  • 网站制作+资讯网站特色栏目重要性
  • 网站qq 微信分享怎么做的随州市住房和城乡建设部网站