font-awesome,fontawesome显示方框,不显示

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

由于本人项目迁移更换框架,在框架里有人用到了这个font-awesome,所有的JS CSS

包引入的都正常,就是不显示图标,经过路径检查没发现问,最后我在别人文章里,发现

web.xml静态文件被拦截了所以,无法显示改图标。

web.xml添加

    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>*.svg</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>*.eot</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>*.woff</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>*.ttf</url-pattern>

    </servlet-mapping>

添加之后显示正常,特此记录一下。

展开阅读全文

弹出对话框显示数据,不弹出不显示

10-22

我现在做的一个电子秤串口程序。就是把称出来的数据显示在窗体上,在保存在Excel里面。rn现在问题是我在接收数据的时候用MessageBox.Show(a)弹出接收的数据(a是接收的数据) 它就会显示在窗体上面。rn如果不用MessageBox.Show(a) 它就不会显示在窗体上面。请问这是什么问题?rn #region 打开串口rn private void btnStart_Click(object sender, EventArgs e)rn rn if (StartBool == false)rn rn tryrn rn this.ClosingBool = false;//是否正在关闭串口rn this.Listening = false;//是否正在接收数据rn this.StartBool = true;rnrn this.txtReceiveData.Text = "";rn this.serialPort1.PortName = "COM1";rn this.serialPort1.BaudRate = 9600;rn this.serialPort1.DataBits = 8;rn this.serialPort1.Parity = System.IO.Ports.Parity.None;rn this.serialPort1.StopBits = System.IO.Ports.StopBits.One;rnrn if (this.serialPort1.IsOpen == false)rn rn this.serialPort1.Open();rn MessageBox.Show("打开串口成功!");rn this.btnStop.Enabled = true;rn this.btnStart.Enabled = false;rn rn rn catchrn rn if (this.serialPort1.IsOpen == true)rn rn this.serialPort1.Close();rn rn MessageBox.Show("打开串口失败");rn rn rn rn #endregionrnrn #region 读取数据rn private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)rn rn if (ClosingBool) return; //如果正在关闭,忽略关闭操作,尽快的完成本次数据的读取rn tryrn rn Listening = true; //设置标记,说明我现在开始读取数据rn int n = this.serialPort1.BytesToRead;rn byte[] buf = new byte[n];rn this.serialPort1.Read(buf, 0, n);rn this.txtReceiveData.Invoke((EventHandler)(delegatern rn string receiveData = Encoding.ASCII.GetString(buf);rn string[] aaa = receiveData.Split(new char[] '\n' );rn //MessageBox.Show(receiveData.ToString());rn if (receiveData.Length == 8)rn rn Data2 = "DATA:20";rn rn if (aaa.Length == 6 && receiveData.Contains("NW:") && aaa[3].Contains(".")==true)rn rn Data = Data2 + aaa[0].ToString();rn NO = aaa[1].ToString();rn GW = aaa[2].ToString();rn NW = aaa[3].ToString();rnrn DataRow d = dtable.NewRow();rn d["Data"] = Data;rn d["NO"] = NO;rn d["GW"] = GW;rn d["NW"] = NW;rn dtable.Rows.Add(d);rn rnrn if (Data.Contains("DATA:") == true && Data.Length > 5)rn rn this.txtReceiveData.AppendText("DATA:" + Data.Substring(5, Data.Length - 5) + "\n");//2001-02-02rn rn if (NO.Contains("NO:") == true && NO.Length > 3)rn rn this.txtReceiveData.AppendText("NO:" + NO.Substring(3, NO.Length - 3) + "\n");rn rn if (GW.Contains("GW:") == true && GW.Length > 3)rn rn this.txtReceiveData.AppendText("GW:" + GW.Substring(3, GW.Length - 3) + "\n");rn rn if (NW.Contains("NW:") == true && NW.Length > 3)rn rn this.txtReceiveData.AppendText("NW:" + NW.Substring(3, NW.Length - 3) + "\n");//NW:3.113rn rn Data = "";rn NO = "";rn NW = "";rn GW="";rn ));rn rn catchrn rn MessageBox.Show("读取数据异常!");rn rn finallyrn rn Listening = false; //设置标记,说明我本次数据读取完毕rn rn rn #endregionrnrn #region 关闭端口rn private void btnStop_Click(object sender, EventArgs e)rn rn if (this.serialPort1.IsOpen)rn rn while (Listening) Application.DoEvents();rn this.serialPort1.Close();rn if (this.serialPort1.IsOpen == false)rn rn MessageBox.Show("端口已关闭!");rn this.txtReceiveData.Text = "";rn this.btnStart.Enabled = true;rn rn dtable.Clear();rn rn this.serialPort1.Dispose();rn StartBool = false;rn ClosingBool = true;rn rn #endregionrnrn#region 加载rn private void Form1_Load(object sender, EventArgs e)rn rn this.btnStop.Enabled = false;rn dtable = new DataTable();rn dtable.Columns.Add("Data", typeof(string));rn dtable.Columns.Add("NO", typeof(string));rn dtable.Columns.Add("GW", typeof(string));rn dtable.Columns.Add("NW", typeof(string));rn rn #endregionrnrn求高手指教,帮帮忙找下错误 论坛

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