小编Aja*_*y P的帖子

"附加调试器时,"指定的通信资源(端口)已在使用中

我刚刚将Windows Phone 8升级到Windows Phone 8.1.当我将手机连接到电脑并运行我的项目时它给了我

指定的通信资源(端口)已被另一个应用程序使用.

我重新启动了我的PC和手机,删除了所有连接的外部设备,但在通过Visual Studio 2012运行我的代码时仍然出现相同的错误.

我可以看到它部署在手机上,但我无法调试它.调试器没有附加.

这是我的屏幕截图:

在此输入图像描述

visual-studio-2012 windows-phone-8.1

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

Xaml TextBlock设置圆角

我想设置的圆角TextBlockxaml.但是没有这样的财产.

<Grid x:Name="grdDis" Grid.Row="1">
        <TextBlock Text="Description" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Name="txtDescription" Margin="18,10,0,0" Height="128" Width="445"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)

如何设置TextBlock的圆角.并且还想设置TextBlock的背景颜色.

c# xaml textblock windows-phone-7 windows-phone-8

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

使用way2sms api发送短信

我想用way2sms发送短信.我试过以下代码

login.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
  public partial class Login : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnconnect_Click(object sender, EventArgs e)
    {
        Session["id"] = txtmobileno.Text;
        Session["pw"] = txtpw.Text;
        Response.Redirect("/send.aspx");
    }
  }
 }
Run Code Online (Sandbox Code Playgroud)

send.aspx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions; …
Run Code Online (Sandbox Code Playgroud)

c# asp.net way2sms

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

如何在Redirecttoaction中传递List

我想从RedirectToAction方法传递多个参数

我怎么能通过?

我的一种行动方法

 [HttpPost, ActionName("SelectQuestion")]
    public ActionResult SelectQuestion(string email,List<QuestionClass.Tabelfields> model)
    {

        List<QuestionClass.Tabelfields> fadd = new List<QuestionClass.Tabelfields>();
        for (int i = 0; i < model.Count; i++)
        {
            if (model[i].SelectedCheckbox == true)
            {
                List<QuestionClass.Tabelfields> f = new List<QuestionClass.Tabelfields>();
                fadd.Add(model[i]);
            }
        }

        return RedirectToAction("Question", new { email = email, model = fadd.ToList() });
    }
Run Code Online (Sandbox Code Playgroud)

我的另一种行动方法

    [HttpGet]
    public ActionResult Question(string email,List<QuestionClass.Tabelfields> model)
    {
    }
Run Code Online (Sandbox Code Playgroud)

我没有在模型中获得价值.

c# controller actionresult asp.net-mvc-3

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

IHttpActionResult返回Json对象

我创建了一个mvc api返回字符串的方法.但string我没有回来,而是想回来Json Object.这是我的代码.

    [AllowAnonymous]
    [HttpPost]
    [Route("resetpassword")]
    public IHttpActionResult ResetPassword(string email)
    {
        CreateUserAppService();
        string newPassword =_userAppService.ResetPassword(email);

        string subject = "Reset password";
        string body = @"We have processed your request for password reset.<br/><br/>";
        string from = ConfigurationManager.AppSettings[Common.Constants.FromEmailDisplayNameKey];
        body = string.Format(body, newPassword, from);

        SendEmail(email, subject, body, string.Empty);
        return Ok<string>(newPassword);
    }
Run Code Online (Sandbox Code Playgroud)

在这里它返回Ok<string>(newPassword);现在我想要返回Json object.我怎样才能返回Json对象

json asp.net-mvc-4 asp.net-web-api

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

Javascript运行时错误:$未定义

我在Default.aspx页面中添加了脚本.我收到了以下错误. 错误

javascript asp.net jquery

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

使用Linq-to-SQL添加多个记录

我想使用Linq to SQL将多行添加到表中

    public static FeedbackDatabaseDataContext context = new FeedbackDatabaseDataContext();
    public static bool Insert_Question_Answer(List<QuestionClass.Tabelfields> AllList)
    {
          Feedback f = new Feedback();
          List<Feedback> fadd = new List<Feedback>();
            for (int i = 0; i < AllList.Count; i++)
            {
                f.Email = AllList[i].Email;
                f.QuestionID = AllList[i].QuestionID;
                f.Answer = AllList[i].SelectedOption;
                fadd.Add(f);
            }
            context.Feedbacks.InsertAllOnSubmit(fadd);
            context.SubmitChanges();
        return true;            
    }
Run Code Online (Sandbox Code Playgroud)

当我将记录添加到列表对象即fadd时,记录将被覆盖AllList的最后一个值

c# sql-server-2008 linq-to-sql

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

mysql存储过程错误:缺少分号

我有以下商店程序.这给我一些错误

DROP procedure IF exists getQueueMessage;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `getQueueMessage`(msg varchar(100))
BEGIN

SELECT `Name` FROM queues WHERE Id  IN (
SELECT PhysicalQueueId FROM indexqueuemaps WHERE ConditionFieldValue = msg)
END
END$$
DELIMITER ;
Run Code Online (Sandbox Code Playgroud)

它给了我missing semicolon error.不知道为什么会出现这个错误.有人能帮我吗?

mysql stored-procedures

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

在Code第一实体框架中将DbContext转换为Datatable

您好我正在尝试将DbContext结果转换为DataTable.我有一个classClientTemplateModel哪个inherits DbContext.在这个课程中我有一个DbSet对象即 public virtual DbSet<imagecomment> ImageComments { get; set; }.我正在使用Code第一个实体框架.

这是我的查询.

using (ClientTemplateModel context = new ClientTemplateModel(connectionString))
{
  var result = context.ImageComments.Where(p => p.Dcn == dcn).OrderByDescending(p => p.CommentsDateTime);
}
Run Code Online (Sandbox Code Playgroud)

在这里,我想转换resultDataTable.我该怎么转换呢?

c# datatable entity-framework linq-to-sql dbcontext

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

多色自定义搜索栏

我试图用多色的android创建自定义搜索栏.我试过下面的代码

customseekbar.java

int proBarWidth = getWidth();
int proBarHeight = getHeight();
int thumboffset = getThumbOffset();
int lastproX = 0;
int proItemWidth, proItemRight;
for (int i = 0; i < mproItemsList.size(); i++) {
proItem proItem = mproItemsList.get(i);
Paint proPaint = new Paint();
proPaint.setColor(getResources().getColor(proItem.color));

proItemWidth = (int) (proItem.proItemPercentage
        * proBarWidth / 100);

proItemRight = lastproX + proItemWidth;

// for last item give right of the pro item to width of the
// pro bar
if (i == mproItemsList.size() - 1
        && proItemRight != …
Run Code Online (Sandbox Code Playgroud)

java android android-layout

6
推荐指数
1
解决办法
833
查看次数