小编cle*_*ent的帖子

xamarin VisualStudio for ios中没有附加设备

当我尝试使用Visual Studio中的IOS模拟器时,我遇到了麻烦.所以我使用xamarin(最新稳定版)在VS中创建了一个hello world应用程序,我将项目设置为主项目,当我用mac刷新连接时,我无法选择应该在selectList中显示的设备.消息是"没有连接设备":

错误画面

如果我尝试在主机mac上使用xamarin工作室,一切都没问题,示例应用程序构建在iphone模拟器上:

在mac主机上

谢谢你的帮助!

xamarin.ios xamarin

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

如何返回具有特定View的ActionResult(不是控制器名称)

我在MVC Controller中有一个SendMail方法.这个方法调用其他方法ValidateLogin.这是验证登录的签名:

private ActionResult ValidateLogin(Models.ResetPassword model)
Run Code Online (Sandbox Code Playgroud)

当我从SendMail调用ValidateLogin时,出现此异常是因为控制器尝试搜索视图SendMail,但我想加载ResetPassword视图:

Global Error - The view 'SendMail' or its master was not found or no view engine supports the searched locations. The following locations were searched: ...
Run Code Online (Sandbox Code Playgroud)

这是SendMail的代码:

public ActionResult SendMail(string login)
{
        return ValidateLogin(login);
}
Run Code Online (Sandbox Code Playgroud)

如何覆盖return语句中的View?

提前致谢

c# asp.net-mvc asp.net-mvc-4

23
推荐指数
4
解决办法
7万
查看次数

Dropzone没有绑定到模型

我正在使用dropzone.js以包含其他字段的形式上传文件.

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    @Html.DropDownListFor(x => x.installation, Model.installationList, new { data_placeholder = "Select one item please" })
    @Html.ValidationMessageFor(model => model.installation, "", new { @class = "text-danger" })

<div id="files" name="files" class="dropzone"></div>

<input type="submit" value="@Resources.Global.Save" class="btn btn-default" />
}
Run Code Online (Sandbox Code Playgroud)

JS:

Dropzone.options.files = {
            autoProcessQueue: false,
            uploadMultiple: true,
            parallelUploads: 100,
            maxFiles: 100,

            paramName: "files", // The name that will be used to transfer the file
            maxFilesize: 8, // MB
            url: "/ActionPlan/Home/Create"  // Same as URL generated from the form
        };
Run Code Online (Sandbox Code Playgroud)

我的模特: …

asp.net asp.net-mvc dropzone.js

12
推荐指数
1
解决办法
3468
查看次数

dropzone多个区域以相同的形式

我正在制作复杂的表格我想使用多个(不同的)dropzone.js来上传文件.

我是这样做的:

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
... form elements...
<div id="files" name="files" class="dropzone"></div>
}
Run Code Online (Sandbox Code Playgroud)

和JS:

Dropzone.options.files = {
    autoProcessQueue: false,
    uploadMultiple: true,
    parallelUploads: 100,
    maxFiles: 100,

    paramName: "file", // The name that will be used to transfer the file
    maxFilesize: 8, // MB
    url: "/pathToAction"
};
Run Code Online (Sandbox Code Playgroud)

我想同时发送表单的文件和数据,所有映射到控制器的对象,但dropzone需要有"url"才能接受文件上传...如何解决这个问题?也许我可以获取表单元素的url并将其放入url参数?

javascript asp.net asp.net-mvc jquery dropzone.js

9
推荐指数
1
解决办法
1168
查看次数

多个SeekBars监听器

我在同一个视图上有多个搜索栏:

barheures = (SeekBar)findViewById(R.id.barheures); // make seekbar object
        barheures.setOnSeekBarChangeListener(this); // set seekbar listener.
        // since we are using this class as the listener the class is "this"
        barminutes = (SeekBar)findViewById(R.id.barminutes);
        barminutes.setOnSeekBarChangeListener(this); 
Run Code Online (Sandbox Code Playgroud)

以下是列表:

@Override
public void onProgressChanged(SeekBar bar, int progress, boolean fromUser) {
    // TODO Auto-generated method stub
    Log.v("", "" + bar);
    textMinutes.setText("" + progress + "Minute(s)" );
    textHours.setText("" + progress + "Heure(s)" );
}
Run Code Online (Sandbox Code Playgroud)

如果第一个或第二个栏已移入同一个列表器(这是一个好习惯吗?),我想做一些不同的东西,但是如何?在这里,我的应用程序没有做我想要的^^

非常感谢

android seekbar android-layout

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

如何自动为Amazon EC2实例的卷创建快照?

我正在尝试使用脚本自动备份卷.

我按照githubEBS-Snapshot.sh上的脚本进行操作:

#!/bin/bash

# export EC2_HOME='/etc/ec2'  # Make sure you use the API tools, not the AMI tools
# export EC2_BIN=$EC2_HOME/bin
# export PATH=$PATH:$EC2_BIN
# I know all of the above is good to have solution, but not re-usable
# I have captured all of the above in a particular file and lemme execute it
source /etc/environment

PURGE_SNAPSHOT_IN_DAYS=10

EC2_BIN=$EC2_HOME/bin

# store the certificates and private key to your amazon account
MY_CERT='/path/to/certificate-file'
MY_KEY='/path/to/private-file'
# fetching the instance-id from …
Run Code Online (Sandbox Code Playgroud)

linux bash amazon-ec2 amazon-web-services

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

如何在我的vnext应用程序中启用roslyn自动构建

我已经制作了演示应用程序来测试asp vNext和Roslyn的所有新功能,但我无法重现我在演示文稿中看到的内容:编辑控制器的viewbag内容并刷新页面以查看新的viewbag,为什么?

  • 我在我的训练营(Windows10)上用VS 2015创建了一个vNext项目,
  • 选择入门Web项目(带有控制器和一些视图),
  • 启动项目(开始,播放按钮),
  • 去看看,看看内容,
  • 然后在控制器中编辑viewbag,并保存控制器,
  • 在浏览器上按F5并且内容仍然相同,为什么?

Roslyn必须"重新构建"控制器然后如果我按f5我必须看到新内容不是吗?是否有激活该功能的选项?

我确定这是用于视图的视图包,因为当我停止并重新启动项目时,一切正常.

也许是因为roslyn没有被选为编译器,但是vNext需要roslyn才能运行sooo我很困扰:-)

这是我编辑过的控制器:

public IActionResult About()
        {
            ViewBag.Message = "Your application description page. coooooool";

            return View();
        }
Run Code Online (Sandbox Code Playgroud)

和相应的观点:

@{
    ViewBag.Title = "About";
}
<h2>@ViewBag.Title.</h2>
<h3>@ViewBag.Message</h3>

<p>Use this area to provide additional information.</p>
Run Code Online (Sandbox Code Playgroud)

我确定这是roslyn,因为我可以将该代码放在应用程序中而没有任何问题:

string s = nameof(Console.Write);
Run Code Online (Sandbox Code Playgroud)

这是KVM配置:

C:\Program Files (x86)\Microsoft Visual Studio 14.0>kvm list

Active Version     Runtime Architecture Location                       Alias
------ -------     ------- ------------ --------                       -----
       1.0.0-beta1 CLR     amd64        C:\Users\clement\.kre\packages
       1.0.0-beta1 CLR     x86          C:\Users\clement\.kre\packages
       1.0.0-beta1 CoreCLR amd64        C:\Users\clement\.kre\packages
       1.0.0-beta1 …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc roslyn asp.net-core-mvc asp.net-core

5
推荐指数
1
解决办法
1500
查看次数

使用 dropzone 发布正常形式

我按照本教程将 DropZone 包含在传统表单元素中:

HTML

<form id="my-awesome-dropzone" class="dropzone">
  <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. -->

  <!-- Now setup your input fields -->
  <input type="email" name="username" />
  <input type="password" name="password" />

  <button type="submit">Submit data and files!</button>
</form>
Run Code Online (Sandbox Code Playgroud)

和这里的 JS

Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element

  // The configuration we've talked about above
  autoProcessQueue: false,
  uploadMultiple: true,
  parallelUploads: 100,
  maxFiles: 100,

  // The setting up of the dropzone …
Run Code Online (Sandbox Code Playgroud)

ajax asp.net-mvc jquery asp.net-mvc-4 dropzone.js

5
推荐指数
1
解决办法
1867
查看次数

尝试在 VS 中添加文件时加载类型库/DLL 时出错(HRESULT:0x80029C4A)

当我尝试在我的 Web 项目中创建视图时遇到了问题。

这是我的错误信息:

There was an error running the selected code generator: 'Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))'
Run Code Online (Sandbox Code Playgroud)

我已经检查了其他回复。如果我以管理员身份运行或没有运行,同样的问题。我有另一台计算机,在相同的 OS + VS 下没有出现此错误。如果有什么可以复制的,我可以做。

我在事件查看器中找不到此异常以查看详细信息(如何?)

提前致谢

c# asp.net visual-studio visual-studio-2013

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

NSDate,NSCalendar和NSDateComponents计时

NSDate *today = [NSDate date];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
[calendar setTimeZone:[NSTimeZone timeZoneWithName:@"GMT+2"]];

NSDateComponents *dateComponents = [calendar components:(NSDayCalendarUnit | NSWeekdayCalendarUnit) fromDate:today];    

NSInteger day = [dateComponents day];
NSInteger month = [dateComponents month];
NSInteger year = [dateComponents year];

 NSLog(@" %i %i %i ", day, month, year);
Run Code Online (Sandbox Code Playgroud)

该代码显示"12 2147483647 2147483647"

我怎样才能获得月份和年份(整数)

如何添加/转发一天?(如果我们也是这个月的第一个!)

请你注意:-)

iphone cocoa nsdate nscalendar nsdatecomponents

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