小编RFe*_*rda的帖子

可以在一行中写一个ROT13吗?

我有以下代码,我希望看到它作为oneliner.但是,由于我对C#很新,我目前还不知道如何做到这一点......

码:

static string ROT13 (string input)
{
    if (string.IsNullOrEmpty(input)) return input;

    char[] buffer = new char[input.Length];

    for (int i = 0; i < input.Length; i++)
    {
        char c = input[i];
        if (c >= 97 && c <= 122)
        {
            int j = c + 13;
            if (j > 122) j -= 26;
            buffer[i] = (char)j;
        }
        else if (c >= 65 && c <= 90)
        {
            int j = c + 13;
            if (j > 90) j -= 26; …
Run Code Online (Sandbox Code Playgroud)

c# encryption rot13

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

Interbase XE7 和实体框架 6.1.2

目前我正在开发一个项目,我想使用实体框架为 Interbase 数据库创建一个数据库层。唯一的问题是我无法让它工作,所以我求助于我心爱的 SO 合作用户。

我目前正在使用:

  • Visual Studio 2013 高级版

  • Interbase XE7 开发版(在此下载

  • 实体框架 6.1.2

  • Interbase ADO.NET 驱动程序随 Interbase XE7 安装一起提供

在这个例子中,我创建了一个非常简单的数据库,其中只有 1 个UserTypes包含ID和 的表Description

我编写了以下代码来表示我的UserTypes模型和我的上下文(这确实非常基本):

public class MyContext : DbContext
{
    public MyContext(DbConnection connection)
        : base(connection, true)
    { }

    public virtual DbSet<UserTypes> UserTypes { get; set; }
}

public class UserTypes
{
    [Key]
    public int ID { get; set; }

    [StringLength(40)]
    public string Description { get; set; }
} …
Run Code Online (Sandbox Code Playgroud)

c# interbase entity-framework

4
推荐指数
1
解决办法
630
查看次数

使用Delphi XE2中的JclCompression从ZIP存档中删除文件

我有这种情况需要从ZIP存档中删除特定文件.在应用程序中,ZIP文件的所有处理都是使用JclCompression完成的.我想知道你们是否知道如何使用JclCompression从ZIP存档中删除特定文件?(我找不到)

delphi jedi-code-library delphi-xe2

3
推荐指数
1
解决办法
272
查看次数