求大神解决 急

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lh334421/article/details/82830213

求大神解答
如何判定高德地图的事件事件有没有被触发


提交事件的请求
$.ajax({
          url: "", 
          type: "POST",
          dataType: "json",
          data: obj,
          success: function (data) {
            console.log(data);
            if (data.data > 0) {
              // alert(data)//这里的判断怎么写 知道有没有触发下边的事件 触发的话获取的地址信息按填写的发出去  不触发的话 把原来的内容重新发送出去
              var oldaddress = $("#_address").val();
              var $jingdu = $("#_jingdu").val();
              var $weidu = $("#_weidu").val();
              var $dzcode = $("#_mennumber").val();
              if ($jingdu == 0 || $jingdu == 0 || !$jingdu || !$weidu) {
                obj.address_code = $dzcode;
                obj.lon = $jingdu;
                obj.lat = $weidu;
                obj.address = oldaddress;
              }
              console.log("提交对象:" + JSON.stringify(obj));

              // window.location.href = 'organization.html'
            }
          }
        });
      });
    });
高德地图引用的函数

function getcity() {
      var cityObj = {};
      //获取用户所在城市信息
      AMap.plugin('AMap.CitySearch', function () {
        var citySearch = new AMap.CitySearch()
        citySearch.getLocalCity(function (status, result) {
          if (status === 'complete' && result.info === 'OK') {
            // 查询成功,result即为当前所在城市信息
            console.log(result)
            //地图加载
            AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch'], function () {
              var autoOptions = {
                // 城市,默认全国 
                city: result.city,
                // 使用联想输入的input的id
                input: "loca"
              };
              var autocomplete = new AMap.Autocomplete(autoOptions);

              var placeSearch = new AMap.PlaceSearch({
                city: result.city,
                //map:map
              });

              AMap.event.addListener(autocomplete, 'select', function (e) {
                //TODO 针对选中的poi实现自己的功能
                console.log(e);
                cityObj.address = e.poi.district + e.poi.name
                cityObj.adcode = e.poi.adcode
                cityObj.lon = e.poi.location.lng
                cityObj.lat = e.poi.location.lat
                console.log(cityObj);

              });
            });
          }
        })
      })
    }



不好写加我微信13691055044

展开阅读全文

急求大神解决

07-23

编译之后出现以下问题,急求大神解决rnfatal error C1083: Cannot open include file: 'save': No such file or directoryrn执行 cl.exe 时出错.rnrn程序:rn#includern#includern#define MVNum 100rn#define Maxint 32767rnenum booleanFALSE,TRUE;rntypedef char VertexType;rntypedef int Adjmatrix;rntypedef structrnrn VertexType vexs[MVNum];rn Adjmatrix arcs[MVNum][MVNum];rnMGraph;rnrnint D1[MVNum],P1[MVNum];rnint D[MVNum][MVNum],P[MVNum][MVNum];rnrn#include"save"rn#include"djstl"rn#include"floyd"rnrnvoid main()rnrn MGraph *G;rn int m,n,e,v,w,k;rn int xz=1;rn G=(MGraph *)malloc(sizeof(MGraph));rn printf("输入交通图中城市个数和路径数n,e:");rn scanf("%d,%d",&n,&e);rn CreateMGraph(G,n,e);rn while(xz!=0)rn rn printf("*******求城市之间的最短路径*******");rn printf("==================================\n");rn printf("1.求一个城市到所有城市的最短路径\n");rn printf("2.求任意的两个城市之间的最短路径\n");rn printf("==================================\n");rn printf(" 请选择: 1或2,选择0 退出:");rn scanf("%d",&xz);rn if(xz==2)rn rn Floyd(G,n);rn printf("输入源点(或称起点)和终点:v,w:");rn scanf("%d,%d",&v,&w);rn k=P[v][w];rn if(k==0)rn printf("顶点%d到%d无路径!\n",v,w);rn elsern rn printf("从顶点%d到%d的最短路径是:%d",v,w,v);rn while(k!=w)rn rn printf("——>%d",k);rn k=P[k][w];rn rn printf("——>%d",w);rn printf(" 路径长度:%d\n",D[v][w]);rn rn rn elsern if(xz==1)rn rn printf("求单源路径,输入源点v:");rn scanf("%d",&v);rn Dijkstra(G,v,n);rn rn rn printf("结束求最短路径!\n");rnrnrnvoid CreateMGraph(MGraph *G,int n,int e)rnrn int i,j,k,w;rn for(i=1;i<=n;i++)rn G->vexs[i]=(char)i;rn for(i=1;i<=n;i++)rn for(i=1;j<=n;j++)rn G->arcs[i][j]=Maxint; //初始化邻接矩阵rn printf("输入%d条边的i,j及w:\n",e);rn for(k=1;k<=e;k++)rn rn scanf("%d,%d,%d",&i,&j,&w);rn G->arcs[i][j]=w;rn rn printf("交通网络图的存储结构建立完毕!\n"); rnrnrnvoid Dijkstra(MGraph *G,int vl,int n)rnrn int D2[MVNum],P2[MVNum];rn int v,i,w,min;rn enum boolean S[MVNum];rn for(v=1;v<=n;v++)rn rn S[v]=FALSE;rn D2[v]=G->arcs[vl][v];rn if(D2[v]arcs[v][w]arcs[v][w];rn P2[w]=v;rn rn rn printf("路径长度 路径\n");rn for(i=1;i<=n;i++)rn rn printf("%5d",D2[i]);rn printf("%5d",i);rn v=P2[i];rn while(v!=0)rn rn printf("<-&d",v);rn v=P2[v];rn rn printf("\n");rn rnrnrnvoid Floyd(MGraph *G,int n)rnrn int i,j,k,w,v;rn for(i=1;i<=n;i++)rn for(j=1;j<=n;j++)rn rn if(G->arcs[i][j]!=Maxint)rn P[i][j]=j;rn elsern P[i][j]=0;rn D[i][j]=G->arcs[i][j];rn rn for(k=1;k<=n;k++)rn rn for(j=1;j<=n;j++)rn rn if(D[i][k]+D[k][j] 论坛

在线急求大神解决

10-18

我现在需要做的是模仿电脑端,写一个给安卓的API接口 其他功能还好,就是请假日期这块搞不懂了,说是根据开始时间,和结束时间来计算,但是他们电脑端写的放法我看不懂,也不知道他们下面写的算法是什么意思。求大神帮忙解决一下,看看我的代码应该怎么修改。 rnpublic static string Insert_Process_List(Obj_User.User _User, Hashtable _PostDate, MySqlConnection _MySqlCon)rn rn Obj_AskLeave.AskLeaveInfo _askleaveInfo = new Obj_AskLeave.AskLeaveInfo(); rn rn _askleaveInfo.ProcessId = long.Parse(_PostDate["ProcessId"].ToString());rn if (_askleaveInfo.ProcessId > 0)rn rn Obj_Process.ProcessInfo _ProcessInfo = new Obj_Process.ProcessInfo();rn _ProcessInfo = Obj_Process.Process.Get_ProcessNextSPInfo(_askleaveInfo.ProcessId, 0, _MySqlCon);rn if (_ProcessInfo.Id > 0)rn rn _askleaveInfo.UserId = _User.Id;rn _askleaveInfo.TimeStart = Convert.ToDateTime(_PostDate["TimeStart"].ToString());rn _askleaveInfo.TimeEnd = Convert.ToDateTime(_PostDate["TimeEnd"].ToString());rn _askleaveInfo.Info =_PostDate["Info"].ToString();rn if (MyPage_Tool.Get_Description(_askleaveInfo.Info).Length >= 5)rn rn _askleaveInfo.AuditUserId = _ProcessInfo.UserId;rn _askleaveInfo.ProcessInfoId = _ProcessInfo.Id;rn _askleaveInfo.SysTime = DateTime.Now;rn _askleaveInfo.Status = 0;rn if (_askleaveInfo.Add(_MySqlCon))rn rn _askleaveInfo.Get_OfUserAndDateTime(_askleaveInfo.UserId, _askleaveInfo.SysTime, _MySqlCon);rnrn rn Set_AskLeaveData(_askleaveInfo, _MySqlCon);rn return "1";rn rn elsern rn return "0";rn rn rn else rn return "请假理由字数小于5";rn rn rn return "部门审批人为空";rn rn rn else rn return "流程ID为空";rn rnrn rn #region 判断日期rn public static void Set_AskLeaveData(Obj_AskLeave.AskLeaveInfo _askleaveInfo, MySqlConnection _MySqlCon)rn rnrn string[] _PageDates = _askleaveInfo.TimeStart.ToString().Split(',');rnrn Obj_AskLeave.DateInfo _Dateinfo = new Obj_AskLeave.DateInfo();rnrnrn foreach (string skey in _PageDates)rn rn tryrn rn string[] _DataInfos = skey.Split('|');rn if (_Dateinfo.UserId <= 0)rn rn _Dateinfo.Date = Convert.ToDateTime(_DataInfos[0]);rn _Dateinfo.UserId = _askleaveInfo.UserId;rn _Dateinfo.AskleaveId = _askleaveInfo.Id;rn rn elsern rn if (_Dateinfo.Date.ToString("yyyy-MM-dd") != _DataInfos[0])rn rn __AddAskLeaveData(_Dateinfo, _askleaveInfo, _MySqlCon);rn _Dateinfo = new Obj_AskLeave.DateInfo();rn _Dateinfo.Date = Convert.ToDateTime(_DataInfos[0]);rn _Dateinfo.UserId = _askleaveInfo.UserId;rn _Dateinfo.AskleaveId = _askleaveInfo.Id;rn rn rnrnrn if (_DataInfos[1] == "AM")rn _Dateinfo.AM = 1;rn if (_DataInfos[1] == "PM")rn _Dateinfo.PM = 1;rn rn catch rn rnrnrn __AddAskLeaveData(_Dateinfo, _askleaveInfo, _MySqlCon);rn _askleaveInfo.TimeStart = Convert.ToDateTime(MyData_MySql.Execute_Scalar("SELECT Min(Date) FROM dailyaffairs_askleavedate WHERE AskleaveId=" + _askleaveInfo.Id, new Hashtable(), _MySqlCon));rn _askleaveInfo.TimeEnd = Convert.ToDateTime(MyData_MySql.Execute_Scalar("SELECT Max(Date) FROM dailyaffairs_askleavedate WHERE AskleaveId=" + _askleaveInfo.Id, new Hashtable(), _MySqlCon));rn _askleaveInfo.Edit(_MySqlCon);rnrn rnrn public static void __AddAskLeaveData(Obj_AskLeave.DateInfo _Dateinfo, Obj_AskLeave.AskLeaveInfo _askleaveInfo, MySqlConnection _MySqlCon)rn rnrn if (_Dateinfo.AM > 0)rn _askleaveInfo.TimeLength++;rn if (_Dateinfo.PM > 0)rn _askleaveInfo.TimeLength++;rnrn if (_Dateinfo.AM > 0 && _Dateinfo.PM > 0)rn _askleaveInfo.TimeInfo = _askleaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "】";rn else if (_Dateinfo.AM > 0)rn _askleaveInfo.TimeInfo = _askleaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "/上午】";rn else if (_Dateinfo.PM > 0)rn _askleaveInfo.TimeInfo = _askleaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "/下午】";rnrn _Dateinfo.Add(_MySqlCon);rn rn-------------这是电脑端的 --------rn#region 获取选择的请假时间 rn tryrn rn _PageDate = Request.Params["Check_Date"].ToString();rn rn catch rnrn if (_PageDate == "")rn rn MyPage_JavaScript.Alert("请选择请假时间!", this);rn return;rn rnrn #endregionrnrn Obj_Process.Process _Process = new Obj_Process.Process();rn _Process.Get(DropDownList_Process.SelectedValue, _MySqlCon);rn if (_Process.Id <= 0)rn rn MyPage_JavaScript.Alert("请选择审批流程!", this);rn return;rn rn _AskLeaveInfo.ProcessId = _Process.Id;rn Obj_Process.ProcessInfo _ProcessInfo = new Obj_Process.ProcessInfo();rn _ProcessInfo = Obj_Process.Process.Get_ProcessNextSPInfo(_Process.Id, 0, _MySqlCon);rn if (_ProcessInfo.Id <= 0)rn rn MyPage_JavaScript.Alert("请选择审批流程!", this);rn return;rn rnrn _AskLeaveInfo.ProcessInfoId = _ProcessInfo.Id;rn _AskLeaveInfo.AuditUserId = _ProcessInfo.UserId; rn _AskLeaveInfo.Info = FCK_Info.Value;rn if (MyPage_Tool.Get_Description(_AskLeaveInfo.Info).Length < 5)rn rn MyPage_JavaScript.Alert("原因不能少于5个字!", this);rn return;rn rn rn _AskLeaveInfo.Status = 0;rn _AskLeaveInfo.SysTime = DateTime.Now;rn _AskLeaveInfo.UserId = _User.Id;rn if (_AskLeaveInfo.Add(_MySqlCon))rn rn //_AskLeaveInfo.Get_OfUserAndDateTime(_AskLeaveInfo.UserId, _AskLeaveInfo.SysTime, _MySqlCon);rn Set_AskLeaveData();rn #region 创建消息rn Obj_Sys.MsgInfo.Set_MsgStatus(_AskLeaveInfo.AuditUserId, Obj_Sys.MsgInfo.MsgStatus.t21, _AskLeaveInfo.Id, 0, _MySqlCon);rn #endregionrn MyPage_JavaScript.AlertAndRedirect("添加成功!", "AskLeave_List.aspx");rn rn elsern MyPage_JavaScript.Alert("添加失败!", this); rn rnrn private void Set_AskLeaveData()rn rn string[] _PageDates = _PageDate.Split(',');rn Obj_AskLeave.DateInfo _Dateinfo = new Obj_AskLeave.DateInfo();rn foreach (string skey in _PageDates)rn rn tryrn rn string[] _DataInfos = skey.Split('|');rn if (_Dateinfo.UserId <= 0)rn rn _Dateinfo.Date = Convert.ToDateTime(_DataInfos[0]);rn _Dateinfo.UserId = _AskLeaveInfo.UserId;rn _Dateinfo.AskleaveId = _AskLeaveInfo.Id;rn rn elsern rn if (_Dateinfo.Date.ToString("yyyy-MM-dd") != _DataInfos[0])rn rn __AddAskLeaveData(_Dateinfo);rn _Dateinfo = new Obj_AskLeave.DateInfo();rn _Dateinfo.Date = Convert.ToDateTime(_DataInfos[0]);rn _Dateinfo.UserId = _AskLeaveInfo.UserId;rn _Dateinfo.AskleaveId = _AskLeaveInfo.Id;rn rn rnrnrn if (_DataInfos[1] == "AM")rn _Dateinfo.AM = 1;rn if (_DataInfos[1] == "PM")rn _Dateinfo.PM = 1;rn rn catch rn rnrnrn __AddAskLeaveData(_Dateinfo);rnrnrnrnrn _AskLeaveInfo.TimeStart = Convert.ToDateTime(MyData_MySql.Execute_Scalar("SELECT Min(Date) FROM dailyaffairs_askleavedate WHERE AskleaveId=" + _AskLeaveInfo.Id, new Hashtable(), _MySqlCon));rn _AskLeaveInfo.TimeEnd = Convert.ToDateTime(MyData_MySql.Execute_Scalar("SELECT Max(Date) FROM dailyaffairs_askleavedate WHERE AskleaveId=" + _AskLeaveInfo.Id, new Hashtable(), _MySqlCon));rn _AskLeaveInfo.Edit(_MySqlCon);rn rnrn private void __AddAskLeaveData(Obj_AskLeave.DateInfo _Dateinfo)rn rn if (_Dateinfo.AM > 0)rn _AskLeaveInfo.TimeLength++;rn if (_Dateinfo.PM > 0)rn _AskLeaveInfo.TimeLength++;rnrn if (_Dateinfo.AM > 0 && _Dateinfo.PM > 0)rn _AskLeaveInfo.TimeInfo = _AskLeaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "】";rn else if (_Dateinfo.AM > 0)rn _AskLeaveInfo.TimeInfo = _AskLeaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "/上午】";rn else if (_Dateinfo.PM > 0)rn _AskLeaveInfo.TimeInfo = _AskLeaveInfo.TimeInfo + "【" + _Dateinfo.Date.ToString("MM-dd") + "/" + MyTool.Get_DayOfWeekOfData(_Dateinfo.Date) + "/下午】";rnrn _Dateinfo.Add(_MySqlCon);rn 论坛

大神,帮我解决一下,急!

02-25

有关调用实时(JIT)调试而不是此对话框的详细信息,rn请参见此消息的结尾。rnrn************** 异常文本 **************rnSystem.DllNotFoundException: 无法加载 DLL“dhnetsdk.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。rn 在 NetSDK.NETClient.CLIENT_Init(fDisConnect cbDisConnect, IntPtr dwUser)rn 在 NetSDK.NETClient.NETInit(fDisConnect cbDisConnect, IntPtr dwUser) 位置 e:\项目\NetSDK\NetSDKCS\NetSDK.cs:行号 400rn 在 Camera.frm_Main.frm_Main_Load(Object sender, EventArgs e) 位置 e:\项目\NetSDK\Camera\frm_Main.cs:行号 219rn 在 System.Windows.Forms.Form.OnLoad(EventArgs e)rn 在 System.Windows.Forms.Form.OnCreateControl()rn 在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)rn 在 System.Windows.Forms.Control.CreateControl()rn 在 System.Windows.Forms.Control.WmShowWindow(Message& m)rn 在 System.Windows.Forms.Control.WndProc(Message& m)rn 在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)rn 在 System.Windows.Forms.ContainerControl.WndProc(Message& m)rn 在 System.Windows.Forms.Form.WmShowWindow(Message& m)rn 在 System.Windows.Forms.Form.WndProc(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)rn 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)rn 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)rnrnrn************** 已加载的程序集 **************rnmscorlibrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dllrn----------------------------------------rnCamerarn 程序集版本:1.0.0.0rn Win32 版本:1.0.0.0rn 基本代码:file:///E:/%E9%A1%B9%E7%9B%AE/NetSDK/Camera/bin/Debug/Camera.exern----------------------------------------rnSystem.Windows.Formsrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dllrn----------------------------------------rnSystem.Drawingrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dllrn----------------------------------------rnSystemrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dllrn----------------------------------------rnNetSDKCSrn 程序集版本:1.0.0.0rn Win32 版本:1.0.0.0rn 基本代码:file:///E:/%E9%A1%B9%E7%9B%AE/NetSDK/Camera/bin/Debug/NetSDKCS.DLLrn----------------------------------------rnSystem.Configurationrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dllrn----------------------------------------rnSystem.Xmlrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dllrn----------------------------------------rnmscorlib.resourcesrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dllrn----------------------------------------rnSystem.Windows.Forms.resourcesrn 程序集版本:4.0.0.0rn Win32 版本:4.0.30319.18408 built by: FX451RTMGRELrn 基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dllrn----------------------------------------rnrn************** JIT 调试 **************rn要启用实时(JIT)调试,rn该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置rnjitDebugging 值。rn编译应用程序时还必须启用rn调试。rnrn例如:rnrnrn rnrnrn启用 JIT 调试后,任何未经处理的异常rn都将被发送到在此计算机上注册的 JIT 调试器,rn而不是由此对话框处理。rnrnrn我不知道怎么就出现了这种问题,之前我都没有碰到过,求大神教我怎么处理,谢谢! 论坛

急求大神帮忙!!!急!!!

12-28

编写一个C++学生成绩管理系统,能完成对10个学生成绩进行处理的相关功能。功能包括输入学生成绩、显示学生成绩、查找某一成绩、输出最高成绩、插入一个成绩、排序、退出程序等。n具体运行界面如下:n1.欢迎及相关功能选择界面n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281711_136954.png)n2.确定功能选择的界面n当输入1时,出现询问是否确定选择此功能。n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281762_185736.png)n当输入N时,出现如下界面,再次输入选择的功能编号。n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281774_845383.png)n如果输入其他功能时,都与输入1类似。当输入Y时,进入相关功能界面n3. 相关功能界面n(1)1输入功能界面n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281792_903665.png)n输入成绩后,如下n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281805_216775.png)n(2)2显示界面n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281818_144999.png)n(3)查找功能n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281839_776330.png)n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281850_670178.png)n第几个成绩参看排序后的位置n(4)最高成绩功能n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281861_701726.png)n(5)插入功能n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281873_542423.png)n插入成功后,选择2显示功能如下:n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281886_38704.png)n(6)排序功能(从高到低排序)n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281897_348801.png)n排序后,输入2显示功能,如下n![图片说明](https://img-ask.csdn.net/upload/201512/28/1451281918_8757.png) 问答

急求大神帮忙!急!!!!!!!!

09-02

MouseListener没有响应,不知道为什么,求大神帮帮忙,看哪不对啊[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif][/img]rn[code=java]import java.awt.BorderLayout;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class MouseTrack implements MouseListenerrn private JFrame myFrame;rn private JTextArea textArea;rn rn public MouseTrack()rn myFrame=new JFrame();rn rn JTextArea textArea=new JTextArea();rn textArea.setEditable(false);rn JScrollPane scroll=new JScrollPane(textArea);rn scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);rn scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);rn rn myFrame.addMouseListener(this);rn rn myFrame.add(scroll,BorderLayout.CENTER);rn rn myFrame.setSize(600,400);rn myFrame.setResizable(false);rn myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn myFrame.setVisible(true);rn rn rn public static void main(String args[])rn MouseTrack frame=new MouseTrack();rn rn rn public void mouseClicked(MouseEvent e) rn System.out.println("***");rn String button;rn if(e.getButton()==e.BUTTON1)rn button="左键";rn rn else if(e.getButton()==e.BUTTON3)rn button="右键";rn rn elsern button="滚轮";rn rn textArea.append("点击了"+button);rn textArea.append("\n点击相对位置:x="+e.getX()+" y="+e.getY());rn textArea.append("点击次数:"+e.getClickCount());rn rn rn public void mousePressed(MouseEvent e)rn public void mouseReleased(MouseEvent e)rn public void mouseEntered(MouseEvent e)rn public void mouseExited(MouseEvent e) ;rnrn[/code] 论坛

大神指教!急!

09-07

[align=left]我想做个闹钟提醒,在EssayActivity中设置时间,启动服务,获取系统时间,两者相等闹钟响。但是service中一直有错(异常)Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1140 android.content.ContextWrapper.sendBroadcast:345 com.android.settings.batterywarning.ReadCodeTask.sendWarningMessage:59 com.android.settings.batterywarning.ReadCodeTask.run:41 java.util.Timer$TimerImpl.run:284 rn断电调试一直从timer.scheduleAtFixedRate(new TimerTask() 跳到最后 , 0,1000*60);rn线面附上源代码,球大神指教!rnpackage com.example.notepad;rnrnimport java.util.Timer;rnimport java.util.TimerTask;rnrnimport android.app.AlertDialog;rnimport android.app.Service;rnimport android.content.DialogInterface;rnimport android.content.Intent;rnimport android.hardware.SensorManager;rnimport android.media.AudioManager;rnimport android.media.SoundPool;rnimport android.os.IBinder;rnimport android.os.Vibrator;rnimport android.text.format.Time;rnimport android.util.Log;rnrnpublic class EssayService extends Servicern private static final String TAG="EssayService";rn private SensorManager mgr;//传感器rn private Vibrator vibrator;//震动马达rn private SoundPool soundPool;//声音播放对象rn private int streamID =0;//音效流rn private Timer timer;rn public static double year=0;rn public static double month=0;rn public static double day=0;rn public static double hour=0;rn public static double minute=0;rnrnrnrn @Overridern public void onCreate() rn // TODO Auto-generated method stubrn super.onCreate();rn //初始化音效rn soundPool=new SoundPool(10, AudioManager.STREAM_SYSTEM, 5);rn soundPool.load(this, R.raw.kid, 1);rn //获得传感器rn mgr=(SensorManager)getSystemService(SENSOR_SERVICE);rn vibrator=(Vibrator)getSystemService(VIBRATOR_SERVICE);rnrn year=EssayActivity.year;rn month=EssayActivity.month;rn day=EssayActivity.day;rn hour=EssayActivity.hour;rn minute=EssayActivity.minute;rnrn rnrnrnrnrn @Overridern public void onDestroy() rn // TODO Auto-generated method stubrn //Service结束时停止音效播放rn if(streamID!=0)rn soundPool.stop(streamID);rn rn if(timer!=null)rn timer.cancel();rn rn super.onDestroy();rn rnrnrnrnrn @Overridern public int onStartCommand(Intent intent, int flags, int startId) rn // TODO Auto-generated method stubrn Log.i(TAG, "服务启动");rn //启动服务rn if(timer!=null)rn timer.cancel();rn rn timer=new Timer();rn timer.scheduleAtFixedRate(new TimerTask() rnrn @Overridern public void run() rn// TODO Auto-generated method stubrnrn//获取当前系统同时间rn Time t=new Time();rn t.setToNow();rn double tYear=t.year;rn double tMonth=t.month;rn double tDay=t.monthDay;rn double tHour=t.hour;rn double tMinute=t.minute;rnif(year==tYear&&month==tMonth&&day==tDayrn &&hour==tHour&&minute==tMinute)rn//振动,播放声音rnvibrator.vibrate(1000);rnif(streamID==0)rnstreamID=soundPool.play(1, 1, 1, 0, -1, 1);rn rnnew AlertDialog.Builder(EssayService.this)rn.setTitle("是否取消?")rn.setNegativeButton("是", new DialogInterface.OnClickListener() rnrn @Overridern public void onClick(DialogInterface dialog, int which) rn// TODO Auto-generated method stubrn if(timer!=null)rn timer.cancel();rn timer.purge();rn rnrn)rn.setNegativeButton("取消", new DialogInterface.OnClickListener() rnrn@Overridernpublic void onClick(DialogInterface dialog, int which) rn// TODO Auto-generated method stubrnrnrn)rn.show();rnrnrn, 0,1000*60);rnreturn super.onStartCommand(intent, flags, startId);rnrnrnrnrnrn @Overridernpublic IBinder onBind(Intent intent) rn// TODO Auto-generated method stubrnreturn null;rnrnrnrn下面是从EssayActivity转到service的代码rncase R.id.btnClock:rn LayoutInflater inflater=getLayoutInflater();rn final View layout=inflater.inflate(R.layout.timeset, rn(ViewGroup)findViewById(R.id.dialog));rnfinal EditText passText=new EditText(this);rnpassText.setInputType(InputType.TYPE_CLASS_TEXT);rnnew AlertDialog.Builder(EssayActivity.this)rn.setTitle("请输入提示日期:")rn.setView(layout)rn.setPositiveButton("确定", new DialogInterface.OnClickListener() rn rn@Overridernpublic void onClick(DialogInterface dialog, int which) rnLayoutInflater factory = LayoutInflater.from(log.this);rnfinal View textEntryView = factory.inflate(R.layout.dialog, null);rnrn rnEditText editYear=(EditText)layout.findViewById(R.id.editYear);rnEditText editMonth=(EditText)layout.findViewById(R.id.editMonth);rnEditText editDay=(EditText)layout.findViewById(R.id.editDay);rnEditText editHour=(EditText)layout.findViewById(R.id.editHour);rnEditText editMinite=(EditText)layout.findViewById(R.id.editMinite);rntryrnyear=Double.parseDouble(editYear.getText().toString());rnmonth=Double.parseDouble(editMonth.getText().toString());rnday=Double.parseDouble(editDay.getText().toString());rnhour=Double.parseDouble(editHour.getText().toString());rnminute=Double.parseDouble(editMinite.getText().toString());rncatch(Exception e)rne.printStackTrace();rn[align=left]rnsaveEssayPassword();rnIntent intent=new Intent(EssayActivity.this,EssayService.class);rnstartService(intent);rn rnrn)rn.setNegativeButton("取消",[/align] new DialogInterface.OnClickListener() 论坛

大神指导!!~~急

01-23

Linux挂载存储服务器失败rn存储服务器已经映射到主机,Linux可以发现,并且登录.rn[root@master /]# iscsiadm -m session -o show rntcp: [17] 10.1.1.2:3260,3 iqn.1986-03.com.ibm:2145.cunchu02.node1 (non-flash)rntcp: [18] 10.1.1.21:3260,3 iqn.1986-03.com.ibm:2145.cunchu01.node2 (non-flash)rntcp: [19] 10.1.1.1:3260,3 iqn.1986-03.com.ibm:2145.cunchu01.node1 (non-flash)rn使用的是multipath多路径,配置如下rnblacklist rn devnode "^sda"rnrndefaults rn user_friendly_names yesrn path_grouping_policy multibusrn failback immediatern no_path_retry failrnrn可是在fdisk和partitions中没有发现,我不知道哪里出现错误了rnrn[root@master /]# cat /proc/partitions rnmajor minor #blocks namernrn 8 0 1169920000 sdarn 8 1 204800 sda1rn 8 2 1048576 sda2rn 8 3 1168664576 sda3rn 253 0 52428800 dm-0rn 253 1 4194304 dm-1rn 253 2 1112039424 dm-2rn 7 0 2880 loop0rn 7 1 488281 loop1rn 253 3 204800 dm-3rn[root@master /]# fdisk -lrnWARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.rnrnDisk /dev/sda: 1198.0 GB, 1197998080000 bytes, 2339840000 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 262144 bytes / 262144 bytesrnDisk label type: gptrnDisk identifier: 795E086A-1F39-4BD1-B589-FB71E3F07825rnrnrn# Start End Size Type Namern 1 2048 411647 200M EFI System EFI System Partitionrn 2 411648 2508799 1G Microsoft basic rn 3 2508800 2339837951 1.1T Linux LVM rnrnDisk /dev/mapper/cl-root: 53.7 GB, 53687091200 bytes, 104857600 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 262144 bytes / 262144 bytesrnrnrnDisk /dev/mapper/cl-swap: 4294 MB, 4294967296 bytes, 8388608 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 262144 bytes / 262144 bytesrnrnrnDisk /dev/mapper/cl-home: 1138.7 GB, 1138728370176 bytes, 2224078848 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 262144 bytes / 262144 bytesrnrnYou must set cylinders.rnYou can do this from the extra functions menu.rnrnDisk /dev/loop0: 2 MB, 2949120 bytes, 5760 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 512 bytes / 512 bytesrnDisk label type: dosrnDisk identifier: 0x00000000rnrn Device Boot Start End Blocks Id SystemrnrnDisk /dev/loop1: 499 MB, 499999744 bytes, 976562 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 512 bytes / 512 bytesrnrnrnDisk /dev/mapper/vg1-data1: 209 MB, 209715200 bytes, 409600 sectorsrnUnits = sectors of 1 * 512 = 512 bytesrnSector size (logical/physical): 512 bytes / 512 bytesrnI/O size (minimum/optimal): 512 bytes / 512 bytesrnrnrnrn 论坛

大神帮忙解决

02-24

import java.io.*;rnpublic class Calculator rn // 定义相关变量rn private String sum = null;rn private String qbrc = null;rn private double qbr1 = 1;rn private double qbr2 = 1;rn String abr1;rn String abr2;rn public Calculator()rn rn rn public void sumT()rn /*rn * 接口功能:进行相关的输入和类型转换 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn System.out.println("欢迎使用!!!/n此计算器除可以进行数字各种相关运算还可以进行字符串的相加");rn System.out.print("请您输入您的第一次输入:");rn BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请输入您的第二次输入:");rn BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请选择符号(+、—、*、/):");rn BufferedReader brc = new BufferedReader(new InputStreamReader(System.in));rn qbrc = brc.toString();rn abr1 = br1.toString();rn abr2 = br2.toString();rn catch(Exception e)rn e.printStackTrace();rn System.err.println("操作有误,请重新操作!!!");rn rn tryrn qbr1 = Double.parseDouble(abr1);rn qbr2 = Double.parseDouble(abr2);rn rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("***"+abr1+abr2+"***");rn rn /*rn * 接口功能:进行相关运算并输出结果 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn if(qbrc=="+")rn double resultOf = qbr1+qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="-")rn double resultOf = qbr1-qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="*")rn double resultOf = qbr1*qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="/")rn double resultOf = qbr1/qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("**********\n您的除数不能为零!!!\n**********");rn rn rn rn rn /**rn * @param argsrn */rn public static void main(String[] args) rn Calculator calculator = new Calculator();rn calculator.sumT();rn rnrnrn 论坛

急求大神分析程序

08-05

该程序是为了实现查字典功能,英汉,汉英翻译。新增单词之后不能查找到,提示段错误。弄了好几天了还是不知道哪里有错误!rnapp.crnrn#includern#includern#include"module.h"rn#include"app.h"rnrnvoid function()rnrn char input[100];rn vocab * wp1;rn vocab * wp2;rn display();rn printf("If you want to translate words,please input 1\n");rn printf("If you want to add the new words,please input 2\n");rn printf("If you want to exit,please input 0\n");rn while(1)rn rn printf("\nplease input your chioce:");rn int choice;rn scanf("%d",&choice);rn switch(choice)rn rn case 0 : exit(1);rn rn case 1 : printf("please input a word :");rn scanf("%s",input);rn wp1 = import();rn rn while(!compare(wp1->word,input))rn rn if(wp1->next != NULL)rn wp1 = wp1->next;rn else break;rn rn rn if(wp1->next != NULL)rn rn outPut(wp1);rn rn rn elsern rn wp2 = importnew();rn while(!compare(wp2->word,input))rn rn if(wp2->next != NULL)rn wp2 = wp2->next;rn else break;rn rn rn if(wp2->next != NULL)rn outPut(wp2);rn elsern printf("\nCan't find you word");rn rn break;rn rn case 2 : addnew();rn break;rn rn printf("\n");rn rnrnrnapp.hrnrn#ifndef __APP_H__rn#define __APP_H__rnrnextern void function();rnrnrn#endifrnrnmodule.crnrn#includern#includern#includern#include"module.h"rnrnlexicon import(void)rnrn int i = 0;rn char c1,c2;rn FILE *fp = NULL;rn fp = fopen("dict.txt","r");rn if(fp == NULL)rn rn fprintf(stderr,"Failed to open dict\n");rn exit(1);rn rn rn lexicon head,p1,p2;rn head = NULL;rn p1 = (lexicon)malloc(sizeof(vocab));rn p2 = (lexicon)malloc(sizeof(vocab));rn for(i = 0;;i++)rn rn c1 = fgetc(fp);rn c2 = fgetc(fp);rn if(c1 != '\n')rn p1->word[i] = c2;rn else break;rn rn rn for(i = 1;;i++)rn rn c1 = fgetc(fp);rn if(c1!='\n')rn rn p1->trans[0] = 'T';rn p1->trans[i] = c1;rn rn else break;rn rn head = p1;rn rn dorn p2->next = p1;rn p2 = p1;rn p1 = (lexicon)malloc(sizeof(vocab));rn rn for(i = 0; ;i++)rn rn c1 = fgetc(fp);rn if(c1 != '\n')rn p1->word[i] = c1;rn else rn break;rn rn for(i = 0; ;i++)rn rn c1 = fgetc(fp);rn if(c1 != '\n')rn p1->trans[i] = c1;rn else rn break;rn rn while((c1 = fgetc(fp)) != EOF);rn p2->next = NULL;rn fclose(fp);rn return(head);rnrnrnint compare(char *str1,char *str2)rnrnrn if(strcmp(str2,str1) == 0)rn rn return 1;rn rn else rn rn return 0;rn rnrnrnint outPut(lexicon wp)rnrn int i = 0;rn for(i = 0;i <= 50;i++)rn rn printf("%c",wp->trans[i]);rn rn return 0;rnrnrnvoid addnew()rnrn char c;rn char s1[100],s2[100]; rn FILE *fp = NULL;rn fp = fopen("newfile.txt","a+");rn if(fp == NULL)rn rn fprintf(stderr,"failed to open newfile\n");rn exit(1);rn rn scanf("%s",s1);rn fprintf(fp,"%s",s1);rn fprintf(fp,"\n");rn fflush(fp);rn while( (c = getchar() ) =='\n' )rn rn rn rn fgets(s2,99,stdin);rn fprintf(fp,"T");rn fprintf(fp,"%s",s2);rn fclose(fp);rnrnrnlexicon importnew(void)rnrn int i = 0;rn char c1,c2;rn FILE *fp = NULL;rn fp = fopen("newfile.txt","r");rn if(fp == NULL)rn rn fprintf(stderr,"Failed to open newfile\n");rn exit(1);rn rn rn lexicon head,p1,p2;rn head = NULL;rn p1 = (lexicon)malloc(sizeof(vocab));rn p2 = (lexicon)malloc(sizeof(vocab));rn rn for(i = 0;;i++)rn rn c1 = fgetc(fp);rn c2 = fgetc(fp);rn if(c1 != '\n')rn p1->word[i] = c2;rn else break;rn rn rn for(i = 1;;i++)rn rn c1 = fgetc(fp);rn if(c1!='\n')rn rn p1->trans[0] = 'T';rn p1->trans[i] = c1;rn rn else break;rn rn head = p1;rnrn dorn p2->next = p1;rn p2 = p1;rn p1 = (lexicon)malloc(sizeof(vocab));rn for(i = 0; ;i++)rn rn c1 = fgetc(fp);rn if(c1 != '\n')rn p1->word[i] = c1;rn else break;rn rn for(i = 0; ;i++)rn rn c1 = fgetc(fp);rn if(c1 != '\n')rn p1->trans[i] = c1;rn else break;rn rn while((c1 = fgetc(fp)) != EOF);rn p2->next = NULL;rn fclose(fp);rn return(head);rnrnrnvoid display()rnrn printf("\n\t************************************************");rn printf("\n\t* *");rn printf("\n\t* W E *");rn printf("\n\t* *");rn printf("\n\t* Electronic Dictionary *");rn printf("\n\t* *");rn printf("\n\t* *");rn printf("\n\t* *");rn printf("\n\t* 1----Translation *");rn printf("\n\t* 2----Add new words *");rn printf("\n\t* 0----Exit *");rn printf("\n\t* *");rn printf("\n\t************************************************");rn printf("\n\n");rn rn rnrnmodule.hrn#ifndef __MODULE_H__rn#define __MODULE_H__rnrntypedef struct vocabrnrn char word[100];rn char trans[300];rn struct vocab *next;rnvocab,*lexicon;rnrnextern lexicon import(void);rnextern char *getOut(lexicon wp,char wd[]);rnextern int compare(char *, char * );rnextern int outPut(lexicon wp);rnextern void display();rnextern void addnew();rnextern lexicon importnew(void);rnrnrn#endifrnrnmain.crn#includern#include"module.h"rn#include"app.h"rnint main(int argc,char* argv[])rnrn function();rn return 0;rnrnrnrnrnrnrn rn rn 论坛

没有更多推荐了,返回首页