小编jga*_*fin的帖子

EditText,inputType值(xml)

我在哪里可以找到InputType可以拥有的值?

我知道http://developer.android.com/reference/android/text/InputType.html,但是布局xml文件中的值应如何?

layout android android-edittext android-inputtype

121
推荐指数
2
解决办法
16万
查看次数

如何在真实设备上调试(使用Eclipse/ADT)

我正在试图弄清楚如何直接在手机上调试应用程序(HTC Desire).

我已经安装了手机附带的USB驱动程序,并且在使用"adb devices"时列出了手机.

如何配置eclipse/ADT以在手机上启动而不是启动模拟器/虚拟设备?

debugging android device adt eclipse-adt

65
推荐指数
2
解决办法
18万
查看次数

如何在sql server中删除外键约束?

我想从另一个表中删除外键,以便我可以插入我选择的值.

我是数据库的新手,所以请告诉我正确的sql查询删除或删除外键值.

database sql-server foreign-keys

65
推荐指数
4
解决办法
24万
查看次数

Razor中的ContentPlaceHolder?

我可以将ContentPlaceHolder与Webforms视图引擎一起使用,将东西放在母版页的不同位置.

我怎么用Razor做到这一点?

    <div id="content">
        <asp:ContentPlaceHolder ID="MainContent" runat="server">
        </asp:ContentPlaceHolder>
    </div> 
    <div id="footer">
        <asp:ContentPlaceHolder ID="Footer" runat="server">
        </asp:ContentPlaceHolder>
    </div>
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc razor

56
推荐指数
2
解决办法
2万
查看次数

DTO到TypeScript生成器

我有一个C#库(程序集),它包含一组DTO,我用它来填充我的挖空模型(TypeScript).

我想确保JSON数据和ViewModel之间的映射是正确的.

是否有一个工具可以从我的C#类生成TypeScript类?像T4或类似的东西(或只是作为POST构建事件运行的命令行工具)?

(请注意,TypeScript文件必须放在除DTO程序集之外的另一个项目中)

c# typescript

52
推荐指数
4
解决办法
2万
查看次数

使用REST Web服务的最佳方式是什么?

从.NET使用REST Web服务的最佳方法是什么?

.net rest web-services

47
推荐指数
3
解决办法
5万
查看次数

将JSON数组反序列化为强类型.NET对象

当我可以调用第三方api并获取单个类的数据时,所有内容都使用此代码进行反序列化

TheUser me = jsonSerializer.Deserialize(response, typeof(TheUser)) as TheUser
Run Code Online (Sandbox Code Playgroud)

当我尝试反序列化作为数组的JSON响应内容时会出现问题,例如

{
   "data": [
      {
         "name": "A Jones",
         "id": "500015763"
      },
      {
         "name": "B Smith",
         "id": "504986213"
      },
      {
         "name": "C Brown",
         "id": "509034361"
      }
   ]
}
Run Code Online (Sandbox Code Playgroud)

如果我在"data"成员周围使用自定义包装类并且该成员需要是类型,我只能使序列化工作List<object>.如果它有类型List<TheUser>ArgumentExceptionJsonParser DesializeType方法得到它们.

我原本试图在没有像这样的包装类型的情况下进行序列化

List<TheUser> freinds = jsonSerializer.Deserialize(response, typeof(List<TheUser>)) as List<TheUser>;
Run Code Online (Sandbox Code Playgroud)

但这只会给我一个空集合.当然,我必须能够将数组反序列化为强类型列表.

c# json.net windows-phone-7 hammock

43
推荐指数
5
解决办法
10万
查看次数

将JSON转换为uri编码的字符串

我有一个JSON/javascript对象,我想得到x-www-form-urlencoded.

$('#myform').serialize()物体一样的东西.

以下对象:

{
    firstName: "Jonas",
    lastName: "Gauffin"
}
Run Code Online (Sandbox Code Playgroud)

将被编码为:

firstName=Jonas&lastName=Gauffin (请注意特殊字符应正确编码)

javascript jquery

42
推荐指数
4
解决办法
6万
查看次数

ServiceStack请求DTO设计

我是一名.Net开发人员,用于在Microsoft Technologies上开发Web应用程序.我正在努力教育自己了解Web服务的REST方法.到目前为止,我喜欢ServiceStack框架.

但有时我发现自己以一种我习惯使用WCF的方式编写服务.所以我有一个问题让我烦恼.

我有2个请求DTO,所以有2个这样的服务:

[Route("/bookinglimit", "GET")]
[Authenticate]
public class GetBookingLimit : IReturn<GetBookingLimitResponse>
{
    public int Id { get; set; }
}
public class GetBookingLimitResponse
{
    public int Id { get; set; }
    public int ShiftId { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public int Limit { get; set; }

    public ResponseStatus ResponseStatus { get; set; }
}

[Route("/bookinglimits", "GET")]
[Authenticate]
public class GetBookingLimits : IReturn<GetBookingLimitsResponse>
{      
    public DateTime Date …
Run Code Online (Sandbox Code Playgroud)

.net c# servicestack

39
推荐指数
2
解决办法
2万
查看次数

"解密表单cookie时,"在加密操作期间发生错误"

我已经将我的网站上传到网站主办,这个错误出现了;
' 在加密操作期间发生错误.'.

我做了一些研究,似乎将经过形式化的cookie绑定到MachineKey(使用webhost时有所不同).


我找到了一个方法来解决这个问题,但错误仍然存​​在.

码:

/// <summary>
    /// This method removes a cookie if the machine key is different than the one that saved the cookie;
    /// </summary>
    protected void Application_Error(object sender, EventArgs e)
    {
        var error = Server.GetLastError();
        var cryptoEx = error as CryptographicException;
        if (cryptoEx != null)
        {
            FederatedAuthentication.WSFederationAuthenticationModule.SignOut();
            Global.Cookies.FormAuthenticated Cookie = new Global.Cookies.FormAuthenticated();
            Cookie.Delete();
            Server.ClearError();
        }
    }
Run Code Online (Sandbox Code Playgroud)


堆栈跟踪:

[CryptographicException: Error occurred during a cryptographic operation.]
   System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input) +115
   System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.Unprotect(Byte[] protectedData) +59
   System.Web.Security.FormsAuthentication.Decrypt(String encryptedTicket) …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net cryptographicexception

37
推荐指数
9
解决办法
5万
查看次数