我在sqlite数据库中有一个图像的完整路径,它存储在设备中,我需要设置一个带有该图像的UIImage.
例:
NSLog(@"Path %@", imagePath);
Run Code Online (Sandbox Code Playgroud)
输出:
/Users/Sk*****/Library/Application Support/iPhone Simulator/4.3.2/Applications/15977219-DEFE-407A-BB80-72E188E18DD2/Documents/20-10-20111746.png
Run Code Online (Sandbox Code Playgroud) 我正在尝试GET在jQuery中传递参数,这是我在做什么
function getChirurghi() {
var id = "1";
$.ajax({
type: "GET",
url: "/api/ControllerName/GetDataHere",
contentType: "application/json; charset=utf-8",
data: id,
dataType: "json",
success: function (data) {
console.log(data);
},
failure: function (data) {
alert(data.responseText);
},
error: function (data) {
alert(data.responseText);
}
});
}
Run Code Online (Sandbox Code Playgroud)
在服务器端调用了控制器,但是我得到的数据始终为空...
[HttpGet]
public IEnumerable<TypeOfObject> GetDataHere([FromBody]string id)
{}
Run Code Online (Sandbox Code Playgroud)
你知道那是怎么回事吗?
我有以下具有自动属性的类:
class Coordinates
{
public Coordinates(int x, int y)
{
X = x * 10;
Y = y * 10;
}
public int X { get; set; }
public int Y { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
正如您从构造函数中看到的,我需要将值乘以 10。有没有办法在不删除自动属性的情况下做到这一点?
我尝试了以下操作,但不认为它会导致递归,然后一切都变得很顺利
public int X { get {return X;} set{ X *= 10;} }
Run Code Online (Sandbox Code Playgroud)
我想将值赋给 X 和 Y 乘以 10。
Coordinates coords = new Coordinates(5, 6); // coords.X = 50 coords.Y = 60
coords.X = 7; // this gives 7 to X but …Run Code Online (Sandbox Code Playgroud) 很难解释我用"普通"语言编写它的问题所以我只是发布我的代码(它会更容易理解):
我上课了File:
public class File
{
public string Url { get; set; }
public string Name { get; set; }
public string Date { get; set; }
public Bitmap Bitmap { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
所以我创建了一个列表files:
var files = new List<File>();
Run Code Online (Sandbox Code Playgroud)
而且,我已用数据填充它.
现在我有一个string(只有那个.)我想找到包含string在我的列表中的元素的索引.
就像是:
int index = files.IndexOf(new File
{
string.Empty,
myString,
string.Empty,
null
});
Run Code Online (Sandbox Code Playgroud)
任何的想法?
c# ×3
.net ×1
asp.net ×1
coordinates ×1
ios ×1
iphone ×1
javascript ×1
jquery ×1
linq ×1
list ×1
objective-c ×1
uiimage ×1