分类目录

链接

2017 年 11 月
 12345
6789101112
13141516171819
20212223242526
27282930  

近期文章

热门标签

新人福利,免费薅羊毛

关于AJAX跨域调用ASP.NET MVC或者WebAPI服务的问题及解决方案

作者:陈希章 时间:2014-7-3 问题描述 当跨域(cross domain)调用ASP.NET MVC或者ASP.NET Web API编写的服务时,会发生无法访问的情况。 重现方式 使用模板创建一个最简单的ASP.NET Web API项目,调试起来确认能正常工作 创建另外一个项目,仅仅包含一个HTML页面,发起AJAX的调用 在浏览器中打开这个网页,我们会发现如下的错误(405:Method Not Allowed)   【备注】同样的情况,也发生在ASP.NET MVC中。某些时候,MVC也可以直接用来开发服务,与WebAPI相比各有优缺点。下面是一个利用MVC开发...

.NET, 前端 暂无评论 阅读(501)

.net连接MySql:Unable to connect to any of the specified MySQL hosts

MySql.Data.MySqlClient.MySqlException Unable to connect to any of the specif   我的问题是my.cnf配置错误,从官方网站重新下载mysql,把它的My.cnf默认文件覆盖就OK了,这里我上传一份我的MYSQL5.1的my.cnf # Example MySQL config file for large systems. # # This is for a large system with memory = 512M where the system runs mainly # MySQL. # # MySQL programs look for option files in a set of # locations which depend on the deployment platform. # You can copy this option file ...

MySQL 暂无评论 阅读(749)

[真正完美解决]InnoDB: Attempted to open a previously opened tablespace

升级mysql到5.6后,启不了Mysql看error.log 其中关键的一行是: InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_patients/tb_patients uses space ID: 3 at filepath: ./db_patients/tb_patients.ibd. Cannot open tablespace mysql/slave_relay_log_info which uses space ID: 3 at filepath: ./mysql/slave_relay_log_info.ibd 解决办法: 一、打开MAMP PRO,点击主界面左侧LANGUAGES中PHP,右侧Extensions分类中点击Manually enable other extensions右侧按钮(或者打...

MySQL 暂无评论 阅读(834)

解决android 安卓中横屏、竖屏切换 应用崩溃问题

在manifest.xml中对应的activity中加入关键代码: <activity android:name=".Activity.ImageViewActivity" android:configChanges="orientation|screenSize|keyboardHidden" /> 原因: 这是由于横竖屏转换导致activity重跑onCreate方法导致的,有两种解决方案: 1、横竖屏转换的时候不要重新跑onCreate方法,这个可以在manifest.xml的对应activity中增加这个属性:“android:configChanges="orientation|screenSize"”; 2、禁止横竖屏转换,在manifest.xml的对应activity中增加这个属性“andr...

Android 暂无评论 阅读(671)

Linux下查看磁盘与目录的容量df、du

查看目录大小: du -sh 其它用法: df:列出文件系统的整体磁盘使用量; du:评估文件系统的磁盘使用量(常用于评估目录所占容量) df参数: -a:列出所有的文件系统,包括系统特有的/proc等文件系统 -k:以KB的容量显示各文件系统 -m:以MB的容量显示各文件系统 -h:以人们较易阅读的GB,MB,KB等格式自行显示 -H:以M=1000K替代M=1024K的进位方式 -T:连同该分区的文件系统名称(例如ext3)也列出 -i:不用硬盘容量,而以inode的数量来显示

LINUX 暂无评论 阅读(496)

我的第一个开源框架,webspider

最近要写一个爬虫,本来打算用Python来写的,但是好久没用python写过东西了,加上最近的.NET项目都在LINUX上运行了,所以,打算用.NET来写,网上搜索了很多.NET的爬虫框架,运行起都或多或少有点问题,不那么顺手,就自己写了一个,很简单的。 开源地址:https://github.com/BruceProject/WebSpider   My first open source project,WebSpider ! welcome to commit ,issue 我的第一个开源项目,网站蜘蛛!欢迎提问,改进! How to use? 怎么使用? #demo static void Main(string[] args) { C...

.NET 暂无评论 阅读(640)

解决searchview自动获取焦点问题

searchview中的edittext 默认自动获取焦点的 而且会出现小键盘很烦人 <LinearLayout android:id="@+id/focus" android:layout_width="fill_parent" android:layout_height="60dp" android:background="#EAEAEA" android:focusable="true" android:focusableInTouchMode="true" android:gravity="center_vertical" android:orientation="horizontal" > <SearchView android:id="@+id/searchView" android:layout_width="fill_parent" android:layout_height="40dp" android:layout_marginRight="20dp" and...

Android 暂无评论 阅读(882)

解决listView中textview超链接导致listitem点击事件失效问题

ListView的Item里的TextView设置ClickableSpan和LinkMovementMethod导致ListView无法响应点击事件  CharSequence charSequence;         if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {             charSequence = Html.fromHtml(data.getContent(), Html.FROM_HTML_MODE_LEGACY);         } else {             charSequence = Html.fromHtml(data.getContent());         }         this.content.setText(charSequence);         //this.content.setMovementMethod(LinkMo...

Android 暂无评论 阅读(712)

Android中LinearLayout的点击事件如何包含内部的子控件?

在LinearLayout中添加android:descendantFocusability=”blocksDescendants” 顺便提一下父控件和子控件状态跟随 当父控件是布局而子控件是控件时,如果要设置点击效果,可以在父布局里面加上android:clickable="true" ,在子控件里面设置android:clickable="false",并设置状态跟随父布局android:duplicateParentState="true",至于效果,则随自己写吧    

Android 暂无评论 阅读(906)

Linq2db.Oracle使用详解

1.nuget搜索Linq2db   再安装 linq2db.oracle   安装后如下图:   复制第一个出来,改名,去掉.txt,比如dbcontext.tt,后打开,修改数据库连接信息,如下图:   最后执行,执行dbcontext代码如下: 当然,正式环境中,得加上数据库连接配置文件.app.config/web.config <?xml version="1.0" encoding="utf-8" ?> <configuration>   <connectionStrings>      <add name="DefaultConfiguration" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=...

Oracle 暂无评论 阅读(1,384)