小编bri*_*ans的帖子

使用Fiddler和基本身份验证来访问RESTful WebAPI

我有一个没有问题的WebAPI.我已在本地测试并部署到我的服务器并在IIS中配置此服务以使用基本身份验证.我能够浏览我的服务,我收到了我期望的身份验证挑战,并且所有工作都在游泳!现在我想使用Fiddler来测试这个并且我已经构建了一个特定URL的POST,并且我收到了401(未授权)错误.所以我决定在我的Request Header中添加一个base64字符串,现在我收到500错误.

我想知道的是,我的请求标题看起来是否正确?我显然要混淆我的Host和base64字符串,其中包含Authentication challenge的格式username:password.

User-Agent: Fiddler
Host: xxx.xxx.xxx.xxx:xxxx
Content-Length: 185
Content-Type: text/json
Authorization: Basic jskadjfhlksadjhdflkjhiu9813ryiu34
Run Code Online (Sandbox Code Playgroud)

rest fiddler asp.net-web-api

69
推荐指数
4
解决办法
8万
查看次数

传递给LEFT或SUBSTRING函数的长度参数无效

我有以下描述:'样品产品制造商产品名称XYZ - 尺寸',我想从此获得值'产品名称XYZ'.如果这只是一行我只是使用SUBSTRING没有问题,但我有成千上万的记录,虽然初始值Sample Product Maker对于所有产品都是相同的,但产品名称可能不同,我不想要任何东西.连字符.

到目前为止,我已经在这个问题的标题中产生了错误.

SELECT i.Itemid,
       RTRIM(LTRIM(SUBSTRING(i.ShortDescription, 25, (SUBSTRING(i.ShortDescription, 25, CHARINDEX('-', i.ShortDescription, 25)))))) AS ProductDescriptionAbbrev,
       CHARINDEX('-', i.ShortDescription, 0) - 25  as charindexpos
FROM t_items i
Run Code Online (Sandbox Code Playgroud)

我得到'参数数据类型varchar对于子字符串函数的参数3无效'

正如您所看到的,我正在获取sql语句最后一行的值,但是当我尝试将其插入SUBSTRING函数时,我遇到了各种问题.

t-sql

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

将UIDatePicker添加到UIAlertView

我正在尝试将日期选择器添加到警报视图.我可以根据按钮点击将动画添加到屏幕上,我看到一个黑盒但没有日期选择器.

这是我到目前为止所拥有的......

- (IBAction)showDatePicker {
    CGRect frame = CGRectMake(200, self.view.frame.size.height, self.view.frame.size.width, 0);  //CGRectMake(225, 145, 260, 125);
    UIPickerView *datePicker = [[UIPickerView alloc] initWithFrame:frame];
    UIAlertView *showDateAlert = [[UIAlertView alloc]
                                  initWithTitle:@"Enter the Code Date"
                                  message:@"Sample message"
                                  delegate:self
                                  cancelButtonTitle:@"Cancel"
                                  otherButtonTitles:@"Update", nil];

    [self.view addSubview:datePicker];
    [UIView beginAnimations:@"slideIn" context:nil];
    [datePicker setCenter:CGPointMake(datePicker.frame.origin.x, self.view.frame.size.height - datePicker.frame.size.height/2)];
    [UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)

我发现了一个似乎正在工作的示例但我没有在警报框中看到任何对话框或按钮,只有日期选择器本身.我在这里错过了什么吗?

- (IBAction)showDatePicker {
    CGRect frame = CGRectMake(225, self.view.frame.size.height, self.view.frame.size.width, 125);
    UIDatePicker *datePicker = [[UIDatePicker alloc] initWithFrame:frame];
    datePicker = [[UIDatePicker alloc] init];
    datePicker.datePickerMode = UIDatePickerModeDate;

    [datePicker setDate:[NSDate date]];

    UIAlertView *alert; …
Run Code Online (Sandbox Code Playgroud)

uidatepicker uialertview ios

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

UIRefreshControl问题

我正在尝试UIRefreshControl在我的应用程序中实现.我有一个xib文件,我UITableViewController在空的nib文件中添加了一个,并将refresh属性设置为"enabled".此外,我已经添加了代码viewDidLoad和自定义刷新方法.问题是我有一个错误我找不到任何关于....的信息.... viewDidLoad我得到的"属性' refreshControl'没有找到类型的对象ViewController"

- (void)viewDidLoad{

[super viewDidLoad];

self.myTableView =
[[UITableView alloc] initWithFrame:self.view.bounds
                           style:UITableViewStyleGrouped];

self.myTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth |
                                  UIViewAutoresizingFlexibleHeight;

self.myTableView.delegate = self;
self.myTableView.dataSource = self;

[self.view addSubview:self.myTableView];

UIRefreshControl *refresh = [[UIRefreshControl alloc] init];

refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(refreshView:) forControlEvents:UIControlEventValueChanged];

self.refreshControl = refresh;

}

-(void)refreshView:(UIRefreshControl *)refresh {

refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Refreshing data..."];

// custom refresh logic would be placed here...

NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios uirefreshcontrol

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

更新iOS 6.1.2现在我无法存档应用程序xcode

当我想从XCode分发我的应用程序时,我在顶部的列表中选择我的设备,并启用存档我的应​​用程序选项.

我昨晚升级到iOS 6.1.2,现在我的设备不会显示在顶部的下拉列表中,所以我无法存档应用程序.

我该如何解决?

software-distribution archive ios

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