首页 文章 精选 留言 我的

精选列表

搜索[移动应用程序开发],共10012篇文章
优秀的个人博客,低调大师

JSP web应用程序开发教程实验二

版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396229 编码统一utf-8 文件名:e2alert.html <!DOCTYPE html> <html> <head> <meta http-equiv="Conten-Type" content="text/html; charset=UTF-8"> <title>登录失败</title> </head> <body> <h1 align="center"> 用户名或密码不正确!<br> 没有登录!无权访问本网站! </h1> <h1 align="center"><a href="e2login.html">请登录!</a></h1> </body> </html> 文件名:e2check_login.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> </head> <body> <% String name=request.getParameter("username"); String password=request.getParameter("passwd"); if(name.equals("admin") && password.equals("123")) { session.setAttribute("username",name); response.sendRedirect("e2login_success.jsp"); } else { %> <jsp:forward page="e2alert.html"/> <% } %> </body> </html> 文件名:e2login.html <html> <body> <form method=post action="e2check_login.jsp"> <table align="center"> <tr> <td> 用户名: </td> <td> <input type=text name="username"> </td> </tr> <tr> <td> 密码: </td> <td> <input type=text name="passwd"> </td> </tr> <tr> <td colspan=2 align="center"> <input type=submit value="登录"> &nbsp;&nbsp;&nbsp;&nbsp; <input type=reset value="重设"> </td> </tr> </table> </body> </html> 文件名:e2login_success.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@include file="e2session_check.jsp" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>登录成功</title> </head> <body> <br> <hr width=380> <center> <h1> <% out.print(sename); %> 登录成功 </h1> <h2> 欢迎您!<%=sename %> </h2> </center> </body> </html> 文件名:e2session_check.jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> </head> <body> <% String sename=(String)session.getAttribute("username"); if(sename==null || !sename.equals("admin")) { response.sendRedirect("e2alert.html"); } %> </body> </html>

优秀的个人博客,低调大师

JSP web应用程序开发教程实验一

版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396232 编码统一utf-8 文件名:a.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <% int num = Integer.parseInt(request.getParameter("num")); out.println(num+"的平方是:"+num*num); %> </body> </html> 文件名:b.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <jsp:include page="a.jsp"> <jsp:param value="19" name="num"/> </jsp:include> </body> </html> 文件名:ex201.jsp <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> </head> <body> <% Date date = new Date(); int hour = date.getHours(); int minute = date.getMinutes(); int second = date.getSeconds(); if (hour >= 0 && hour < 12) { out.println("早上好!"); } else if (hour >= 12 && hour < 19) { out.println("下午好!"); } else { out.println("晚上好!"); } %> </body> </html> 文件名:test1.jsp <%@ page contentType="text/html;charset=utf-8" %> <% request.setCharacterEncoding("utf-8"); String strUserName = ""; strUserName = (String)request.getParameter("UserID"); if(strUserName.equals("张三")){ out.println("你好" + strUserName); }else{ out.println("名称错误"); } %> <br>姓名:<%=strUserName%><br> 文件名:test2.jsp <%@ page contentType="text/html;charset=utf-8" %> <html><body> <form action= " test1.jsp" method="post"> <p>姓名:<input type="text" size="20" name= "UserID"></p> <p><input type="submit" value="提 交"> </p> </form> </body></html>

优秀的个人博客,低调大师

iOS开发那些-如何打包iOS应用程序

我们把应用上传到App Store之前需要把编译的二进制文件和资源文件打成压缩包,压缩格式是zip。 首页找到编译到什么地方,这个很重要也不太好找,我们可以看看编译日志,找到其中的Create universal binary HelloWorld…的内容,然后展开内容如下: Create Universal Binary /Users/tonyguan/Library/Developer/Xcode/DerivedData/HelloWorld-fzvtlfsmygaqjleczypphenzabef/Build/Products/Release-iphoneos/HelloWorld.app/HelloWorld normal ”armv7 armv7s” cd ”/Users/tonyguan/Desktop/19.1.4 HelloWorld” setenv PATH ”/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin” lipo -create /Users/tonyguan/Library/Developer/Xcode/DerivedData/HelloWorld-fzvtlfsmygaqjleczypphenzabef/Build/Intermediates/HelloWorld.build/Release-iphoneos/HelloWorld.build/Objects-normal/armv7/HelloWorld /Users/tonyguan/Library/Developer/Xcode/DerivedData/HelloWorld-fzvtlfsmygaqjleczypphenzabef/Build/Intermediates/HelloWorld.build/Release-iphoneos/HelloWorld.build/Objects-normal/armv7s/HelloWorld -output /Users/tonyguan/Library/Developer/Xcode/DerivedData/HelloWorld-fzvtlfsmygaqjleczypphenzabef/Build/Products/Release-iphoneos/HelloWorld.app/HelloWorld 在最后日志-output之后就是应用编译之后的位置了,其中“/Users/tonyguan/Library/… /Products/Release-iphoneos/”是编译之后生成的目录,HelloWorld.app是包文件,HelloWorld是二进制文件。 包文件HelloWorld.app可以使用点击右键菜单“显示包内容”,其中HelloWorld文件是我们这个应用的二进制文件。其它的都是资源文件,包括图片、属性列表文件、nib和storyboardc文件,nib是编译之后的xib文件,storyboardc是编译之后的故事板文件等。 应用打包就是将HelloWorld.app包文件打包成为HelloWorld.zip,具体操作是右键点击HelloWorld.app包文件弹出菜单,选择压缩“HelloWorld”,这样就会在当前目录下生成HelloWorld.zip压缩文件了,请将这个文件保存好,我们会在下一节介绍,上传应用时候还会使用到。 本文转自 tony关东升 51CTO博客,原文链接:http://blog.51cto.com/tonyguan/1214979,如需转载请自行联系原作者

优秀的个人博客,低调大师

【移动开发】WIFI热点通信(一)

之前调查过Android中WIFI模块的使用,也写过两篇学习总结的文章(http://smallwoniu.blog.51cto.com/3911954/1334951),后来发现DEMO里面还是有许多不足之处,前段时间有不少人Q我,问到WIFI模块中的一些细节,小弟这里只能说声抱歉,因为当时的我也还没研究到那个层次呀。。。,后来毕业设计选题干脆直接选择了关于WIFI热点通信方面的题目,调查和整理了一些资料,进行了一段时间的学习算是弥补了自己的短板吧,主要还是希望自己能够更加全面的掌握这方面的知识。 废话不多说了!今天主要讲解WIFI热点通信的前期准备工作: 1.热点创建:创建指定名称的热点。 2.热点搜索:搜索附近可用热点,生成列表。 3.热点连接:在列表中点击指定名称的WIFI项,进行连接操作。 一.框架搭建 说明: 1.几个权限: 1 2 3 4 5 6 < uses-permission android:name = "android.permission.INTERNET" /> < uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" /> < uses-permission android:name = "android.permission.CHANGE_NETWORK_STATE" /> < uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" /> < uses-permission android:name = "android.permission.CHANGE_WIFI_STATE" /> < uses-permission android:name = "android.permission.WAKE_LOCK" /> 2.相关类图: 二.模块讲解 接下来通过以下三个部分功能来逐一剖析,在此之前首先看一张最终的效果图加深以下印象: (由于本章讲解的部分是我的整个项目中的一部分,所以大家不用在意图片素材等其他细节) 2.1热点创建 点击WIFI管理界面中创建热点按钮,首先会检测当前WIFI是否可用,若可用则需将其关闭掉才能创建WIFI热点,因为手机热点把手机的接收GPRS或3G信号转化为WIFI信号再发出去,即你的手机就成了一个WIFI热点,所以共享和接收功能是不能同时进行的。之后就是创建指定名称的热点过程。热点创建时序图如下图所示。 几个核心方法: startApWifiHot() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /** *createahotwifi * *@paramwifiName */ public boolean startApWifiHot(StringwifiName){ Log.i(TAG, "intostartApWifiHot(StringwifiName)wifiName=" +wifiName); if (wifiManager.isWifiEnabled()){ wifiManager.setWifiEnabled( false ); } if (mWifiHotAdmin!= null ){ return mWifiHotAdmin.startWifiAp(wifiName); } Log.i(TAG, "outstartApWifiHot(StringwifiName)" ); return false ; } createWifiAp() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 /** *starthotpot *@paramwifiName *@return */ private boolean createWifiAp(StringwifiName){ Log.i(TAG, "intostartWifiAp()启动一个Wifi热点!" ); Methodmethod1= null ; boolean ret= false ; try { //setWifiApEnabledis@hide,soreflect method1=mWifiManager.getClass().getMethod( "setWifiApEnabled" , WifiConfiguration. class , boolean . class ); WifiConfigurationapConfig=createPassHotWifiConfig(wifiName,Global.PASSWORD); ret=(Boolean)method1.invoke(mWifiManager,apConfig, true ); } catch (IllegalArgumentExceptione){ e.printStackTrace(); Log.d(TAG, "stratWifiAp()IllegalArgumentExceptione" ); } Log.i(TAG, "outstartWifiAp()启动一个Wifi热点!" ); return ret; } 2.2热点搜索 点击WIFI管理界面中搜索热点按钮,同创建一样,首先需要检测WIFI热点是否关闭,将其关闭掉后才能打开WIFI搜索功能。在搜索完成后系统会发送WIFI状态变化广播来通知消息栏,这里通过自定义广播接收器接收了搜索成功消息,最后通过回调MainActivity中disPlayWifiScanResult()来显示WIFI列表。 几个核心方法: scanWifiHot() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 /**scanwifihot**/ public void scanWifiHot(){ Log.i(TAG, "intowifiHotScan()" ); if (mWifiHotAdmin.isWifiApEnabled(wifiManager)){ mWifiHotAdmin.closeWifiAp(); } if (!wifiIsOpen()){ //WIFIisclosecurrently //listentothespecifiedSSIDwifistate registerWifiStateBroadcast( "" ); mWifiStateReceiver.setOperationsType(OperationsType.SCAN); //openwifi openWifi(); } else { //WIFIisopencurrently scanNearWifiHots(); } Log.i(TAG, "outwifiHotScan()" ); } scanNearWifiHots() 1 2 3 4 5 6 /**scannearwifi**/ private void scanNearWifiHots(){ registerWifiScanBroadcast(); //startscan wifiManager.startScan(); } 说明:这里的扫描实现过程是通过调用系统中WifiManager中扫描功能。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 /** *Requestascanforaccesspoints.Returnsimmediately.Theavailability *oftheresultsismadeknownlaterbymeansofanasynchronouseventsent *oncompletionofthescan. *@return{@codetrue}iftheoperationsucceeded,i.e.,thescanwasinitiated */ public boolean startScan(){ try { mService.startScan( false ); return true ; } catch (RemoteExceptione){ return false ; } } 2.3热点连接 在搜索完成之后,需要在WIFI列表中找到游戏的热点,点击连接过程会处理一系列逻辑:当前WIFI可用、是否已经连接、注册WIFI状态变化广播等,之后,开启独立线程进行热点匹配连接,热点连接时序图如图所示。 几个核心方法: connectToHotpot() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 /** *connecttohotpot * *@paramssid *@paramwifiList *@parampassword */ public void connectToHotpot(Stringssid,List<ScanResult>wifiList,Stringpassword){ if (ssid== null ||password.equals( "" )||!ssid.equals(Global.HOTPOT_NAME)){ Log.d(TAG, "WIFIssidisnullor" ); mWifiBroadCastOperator.disPlayWifiConnResult( false , null ); return ; } if (ssid.equalsIgnoreCase(mSSID)&&isConnecting){ Log.d(TAG, "samessidisconnecting!" ); mWifiBroadCastOperator.disPlayWifiConnResult( false , null ); return ; } if (!checkCoonectHotIsEnable(ssid,wifiList)){ Log.d(TAG, "ssidisnotinthewifiList!" ); mWifiBroadCastOperator.disPlayWifiConnResult( false , null ); return ; } if (!wifiIsOpen()){ //listentossidwifi registerWifiStateBroadcast(ssid); mWifiStateReceiver.setOperationsType(OperationsType.CONNECT); //openwifi openWifi(); } else { //realconnecting enableNetwork(ssid,password); } } enableNetwork() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 /** *connectwifihotreallybythread * *@paramssid *@parampassword */ private void enableNetwork( final Stringssid, final Stringpassword){ //deletemoreconnetedwifi deleteMoreCon(ssid); registerWifiConnectBroadCast(); new Thread( new Runnable(){ @Override public void run(){ WifiConfigurationconfig=WifiHotConfigAdmin.createWifiNoPassInfo(ssid,password); //ifconnectissuccessful isConnecting=connectHotSpot(config); mSSID=ssid; if (!isConnecting){ Log.i(TAG, "intoenableNetwork(WifiConfigurationwifiConfig)isConnecting=" +isConnecting); return ; } } }).start(); } connectHotSpot() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 /** *connectwifihotifsuccessful * *@paramwifiConfig *@return */ private boolean connectHotSpot(WifiConfigurationwifiConfig){ Log.i(TAG, "intoenableNetwork(WifiConfigurationwifiConfig)" ); //theIDofthenewlycreatednetworkdescription int wcgID=wifiManager.addNetwork(wifiConfig); Log.i(TAG, "intoenableNetwork(WifiConfigurationwifiConfig)wcID=" +wcgID); if (wcgID< 0 ){ return false ; } boolean flag=wifiManager.enableNetwork(wcgID, true ); Log.i(TAG, "outenableNetwork(WifiConfigurationwifiConfig)" ); return flag; } 说明:连接热点的过程实质上就是获取热点配置信息,之后将其添加到自己的网络信息中同时使其可用。 至此,WIFI热点通信的前期工作已经完成,连接的手机端已在同一局域网内,若再有手机连接进来会自动为其分配该网段内的IP地址,接下来我们要做的就是在IP地址上实现数据的传输通信。在下一章中准备实现一个多人聊天室功能,希望能够帮助到大家! 源码下载:http://down.51cto.com/data/1812897 本文转自zhf651555765 51CTO博客,原文链接:http://blog.51cto.com/smallwoniu/1536126,如需转载请自行联系原作者

优秀的个人博客,低调大师

如何迅速开发一款移动App?蚂蚁金服移动开发平台mPaaS来帮你

小蚂蚁说: 时间倒推到两三年前,大家可能对刷支付宝乘公交车和地铁还感到惊奇。但如今,一个外来游客要是来到北上杭这些城市旅游的话,再也不用浪费时间在各个地铁票售卖处排长队买地铁票了。无论是用支付宝扫码进站,还是打开像上海地铁的“METRO大都会”这类App,这些应用的出现和存在最终都是为了方便消费者的日常出行体验。 与此同时,现在的年轻人可能对银行线下网点和人工柜台的服务越来越陌生,因为越来越多的转账、汇款等交易都发生在了线上。多年前春运期间一大清早去火车票网点排队购票的场景也逐渐消失,人们已经习惯用互联网来搞定一切,并习以为常。 但这也变化也不是一夜之间一蹴而就的,那些我们吐槽部分App和线上业务体验不佳的日子似乎还并不遥远。而这些体验的摩擦与交融可以说是各行各业走向数字化转型的一个缩影与阵痛。或许很多年之后回望2017年,人们会认为此

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册