我当前的代码如下,仅下载文件。如何在浏览器中查看所有文件类型?
[HttpGet]
//[NoCacheHeader()]
[Route("api/image/files")]
public HttpResponseMessage GFiles(string ImageName)
{
var response = Request.CreateResponse(HttpStatusCode.OK);
var path = "~/Image/" + ImageName;
path = System.Web.Hosting.HostingEnvironment.MapPath(path);
var ext = System.IO.Path.GetExtension(path);
var contents = System.IO.File.ReadAllBytes(path);
System.IO.MemoryStream ms = new System.IO.MemoryStream(contents);
response.Content = new StreamContent(ms);
//
response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = ImageName;
//
response.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("Image/" + ext);
return response;
}
Run Code Online (Sandbox Code Playgroud) 显然,在 Unity3D 更新后,我无法再从一个场景切换到另一个场景。我不知道这是否是由于更新造成的问题,但目前,当我单击一个应该将我送回另一个场景的按钮时,我收到此错误。
ArgumentException: method return type is incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:190)
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:276)
UnityEngineInternal.NetFxCoreExtensions.CreateDelegate (System.Reflection.MethodInfo self, System.Type delegateType, System.Object target) (at /Users/builduser/buildslave/unity/build/Runtime/Export/WinRT/NetFxCoreExtensions.cs:11)
UnityEngine.Events.InvokableCall..ctor (System.Object target, System.Reflection.MethodInfo theFunction) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:149)
UnityEngine.Events.PersistentCall.GetRuntimeCall (UnityEngine.Events.UnityEventBase theEvent) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:447)
UnityEngine.Events.PersistentCallGroup.Initialize (UnityEngine.Events.InvokableCallList invokableList, UnityEngine.Events.UnityEventBase unityEventBase) (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:610)
UnityEngine.Events.UnityEventBase.RebuildPersistentCallsIfNeeded () (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:776)
UnityEngine.Events.UnityEventBase.PrepareInvoke () (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent.cs:812)
UnityEngine.Events.UnityEvent.Invoke () (at /Users/builduser/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
UnityEngine.UI.Button.Press () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:36)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:45)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler …Run Code Online (Sandbox Code Playgroud) 我是pandas的新手,并试图用df2替换列值(NaN),列值匹配.并面临以下错误.
df1
unique_col | Measure
944537 NaN
7811403 NaN
8901242114307 1
df2
unique_col | Measure
944537 18
7811403 12
8901242114307 17.5
df1.loc[(df1.unique_col.isin(df2.unique_col) &
df1.Measure.isnull()), ['Measure']] = df2[['Measure']]
Run Code Online (Sandbox Code Playgroud)
我有两个数据帧,有300万条记录,并且在执行以下操作时遇到以下错误:
ValueError:无法从重复轴重新索引
我开发了一个简单的应用程序Xamarin forms。它在我的电脑上的 android 模拟器上正常运行。
我已经存档了 android 项目并为其生成了 apk,但是它没有安装在我的 android 手机中。错误信息是
安装应用程序失败
我在构建应用程序和归档时主要使用默认配置值。
只有这些是我更改的配置:
Android Option 未选中Use Shared the runtime。Linking更改none为Sdk assemblies only.Configuration是调试并且平台是活动的(任何CPU)。虽然我尝试安装包含所有三个值的应用程序,
Debug, Release, Active(Debug)但没有安装它们。这里有什么问题吗?
运行声纳分析后,我遇到了错误,我收到错误
使“getPreAHistFlt”成为瞬态或可序列化的“
我们如何解决这个问题?
代码片段:
package com.sanju.p1;
//webfault and namespace
@WebFault(name = "getPreAHistFlt", targetNamespace = "http://www.getPreAuthorizationHistory")
public class getPreAHistFltMsg extends Exception {
private com.sanju.p2.GetPreAHistFlt getPreAHistFlt; // showing bug here
//constructors
public getPreAHistFltMsg() {
super();
}
public getPreAHistFltMsg(String message) {
super(message);
}
public getPreAHistFltMsg(String message, Throwable cause) {
super(message, cause);
}
public getPreAHistFltMsg(String message, com.sanju.p2.GetPreAHistFlt getPreAHistFlt) {
super(message);
this.getPreAHistFlt = getPreAHistFlt;
}
public getPreAHistFltMsg(String message, com.sanju.p2.GetPreAHistFlt getPreAHistFlt, Throwable cause) {
super(message, cause);
this.getPreAHistFlt = getPreAHistFlt;
}
public com.sanju.p2.GetPreAHistFlt getFaultInfo() {
return this.getPreAHistFlt; …Run Code Online (Sandbox Code Playgroud) 我得到以下错误
错误 - 2018-10-01 12:05:23 --> 严重性:错误 --> 异常:调用未定义的函数 mcrypt_create_iv() /var/www/html/application/controllers/api.php 331
在 AWS EC2 ubuntu 16(Php 7.2、Nginx、codeigniter 3.1.9)上部署应用程序
我试图找到调试php文件中的javascript代码的方法.我在php文件中嵌入了很多javascript代码.
我可以在XDebug的帮助下使用netbeans调试php代码.我也可以使用chrome或firefox等浏览器在html或js文件中单独调试javascript.
我想要的是调试php文件中的javascript代码,如果可能的话.我相信很多人会使用嵌入了php文件的javascript.我个人不喜欢它,但我必须继续努力.我知道我可以在js文件中单独编写代码,然后可以使用浏览器进行调试,但是代码很多,需要时间进行分离.
如果有可能,我可以在这里建议我一个方法.
无法将 NodeMCU 与 Firebase 连接,因为控制台显示设置 /number 失败:每次 Firebase 上也没有更新。
还是我应该更换云服务器?
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
// Set these to run example.
#define FIREBASE_HOST "example.firebaseio.com"
#define FIREBASE_AUTH "token_or_secret"
#define WIFI_SSID "SSID"
#define WIFI_PASSWORD "PASSWORD"
void setup() {
Serial.begin(9600);
// connect to wifi.
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println();
Serial.print("connected: ");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
int n = 0;
void loop() {
// set value
Firebase.setFloat("number", 42.0);
// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error()); …Run Code Online (Sandbox Code Playgroud) 我想在我的父div ID(关于我们)内提供80px的上下填充和0的左右填充。因此,我尝试了引导程序4的响应间隔(填充),即py-80,但在这里不起作用。
<div id="about-us" class="py-md-80">
<div class="container text-center">
<h3 class="display-5 text-capitalize">about us</h3>
<p class="text-muted">Divide have don't man wherein air fourth. Own itself
make have night won't make.
A you under Seed appear which good give. Own give air without fowl move the
dry first
heaven fruit, dominion she'd won't very all.</p>
<img src="./imgs/signature.jpg" alt="signarure" class="img-responsive">
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个云函数,它有一些这样的代码:
exports.functionName = functions.https.onCall((data, context) => {
//some logic
b().then(function(otherData){
//further logic
resolve(otherDataModified)
});
});
b = () => {
if(someError){
b();
resolve(); //This is where i made the mistake, this should be returned after b has completed
}else{
resolve();
}
}
Run Code Online (Sandbox Code Playgroud)
现在的问题是,在意识到错误之前我已经两次调用了这个函数,这导致函数 b 进入无限循环,虽然请求已经完成并解决了,我向用户显示了错误,但有两个函数是不断运行到后台,我看不到实际停止执行此操作的选项。
还尝试用正确的逻辑更新函数,新的运行都正常工作,但这次运行完全挂断,如果不检查会导致我产生大量资源计费。