我正在尝试使用ajax请求使用aspnet核心上传文件.在以前的.net版本中我曾经使用过
foreach (string fileName in Request.Files)
{
HttpPostedFileBase file = Request.Files[fileName];
//Save file content goes here
fName = file.FileName;
(...)
Run Code Online (Sandbox Code Playgroud)
但现在它在request.files显示错误我怎么能让它工作?我搜索并发现httppostedfile已更改为iformfile但如何处理request.files?
我正在尝试构建一个共享服务,如下所示
import {Injectable,EventEmitter} from 'angular2/core';
import {Subject} from 'rxjs/Subject';
import {BehaviorSubject} from 'rxjs/subject/BehaviorSubject';
@Injectable()
export class SearchService {
public country = new Subject<SharedService>();
public space: Subject<SharedService> = new BehaviorSubject<SharedService>(null);
searchTextStream$ = this.country.asObservable();
broadcastTextChange(text: SharedService) {
this.space.next(text);
this.country.next(text);
}
}
export class SharedService {
country: string;
state: string;
city: string;
street: string;
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何实现BehaviourSubject基本上我在这里尝试的只是一团糟我猜我在使用子组件调用这个值
console.log('behiob' + shared.space.single());
Run Code Online (Sandbox Code Playgroud)
这是一个错误,因为.single()/ last()等等什么是可用的不是一个函数所以有人可以告诉我它是如何工作的以及如何实现它,因为我搜索的例子但没有一个对我有意义.
我需要创建一个中心有徽标的二维码,所以首先我认为它可能需要一些不同的库。
为了进行实验,我只是使用 Illustrator 将徽标放在提供的二维码的中心,扫描仪就能够读取它。我在徽标下面使用了黑色和白色背景,但它仍然可以正确读取。
所以我的问题是:如果我在任何二维码的中心放置一个徽标,它会正常工作还是我应该使用一个库来解决这个问题?
我有一个父函数ngOnInit()
,它从谷歌地图获取值,如下所示
instance.input = document.getElementById('google_places_ac');
autocomplete = new google.maps.places.Autocomplete(instance.input, { types: ['(cities)']});
google.maps.event.addListener(autocomplete, 'place_changed', function () {
var place = autocomplete.getPlace();
instance.setValue(place.address_components[3].long_name, place.address_components[2].long_name, place.address_components[1].long_name);
});
Run Code Online (Sandbox Code Playgroud)
setValue()
是与共享服务共享价值的函数,在 html 页面上我有与父级和子级相同的内容
<input id="google_places_ac" [(attr.state)]="state" [(attr.country)]="coutnry" name="google_places_ac" type="text" value="{{city}}" class="form-control" />
在父组件类中,我对setValue()
函数触发更改检测
setValue(a, b, c) {
this.coutnry = a;
this.state = b;
this.city = c;
this.sharedService.country = this.coutnry;
this.sharedService.city = this.city;
this.sharedService.state = this.state;
this.cdr.detectChanges();
// console.log(this.coutnry, this.state, this.city);
}
Run Code Online (Sandbox Code Playgroud)
这在父级上运行良好,但在子级上没有发生更改,我创建了一个单击函数,该函数在子级上触发更改检测,这也有效,但我希望它从父级自动触发,有什么解决方法吗?
我的表有3000万行,并且它每天都在增加,但现在只需简单的选择查询
Select top 10 * from table order by entrydate desc
Run Code Online (Sandbox Code Playgroud)
是否需要超过8分钟,任何解决方案?
angular ×2
ajax ×1
asp.net ×1
asp.net-core ×1
file ×1
qr-code ×1
rxjs ×1
sql ×1
sql-server ×1
upload ×1