首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我可以将XML文件存储在哪里,以便浏览器使用ASP.Net MCV读取

我可以将XML文件存储在哪里,以便浏览器使用ASP.Net MCV读取
EN

Stack Overflow用户
提问于 2021-02-06 01:01:33
回答 1查看 52关注 0票数 0

我想在我的网站上有一个xml文件,从数据库中保存临时信息。当我使用VSCode来做这件事时,它工作得很好;但是当我使用我实际的ASP.Net Web应用程序时,它就不行了。我假设它与我正在使用的文件路径有关,任何帮助都将不胜感激!

ASP.Net C#

代码语言:javascript
运行
复制
string path = Server.MapPath("~/App_Data/phones.xml");
foreach (var pm in Model)
{
     // add each model to xml
}

JS

代码语言:javascript
运行
复制
const MakePhoneOBJ = (xmlFile) => {
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function () {
        if (this.readyState == 4 && this.status == 200) {
            xmlFunc(this);
        }
    };
    xmlhttp.open("GET", xmlFile, true);
    xmlhttp.send();
}

const xmlFunc = (xml) => {
    var xmlDoc = xml.responseXML;
    var root = xmlDoc.getElementsByTagName("Element");
    for (let i = 0; i < root.length; i++) {
        // Do something with the file contents
    }
}

HTML

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-02 01:57:26

因此,我正在尝试使用helm3 to kubernetes cluster(EKS)安装一个图表。我有一个terraform配置如下。实际群集处于活动状态且可见

代码语言:javascript
运行
复制
variable "aws_access_key" {}
variable "aws_secret_key" {}

locals {
  cluster_name = "some-my-cluster"
}

provider "aws" {
  region = "eu-central-1"
  access_key = var.aws_access_key
  secret_key = var.aws_secret_key
}


data "aws_eks_cluster" "cluster" {
  name = local.cluster_name
}

data "aws_eks_cluster_auth" "cluster" {
  name = data.aws_eks_cluster.cluster.name
}

output "endpoint" {
  value = data.aws_eks_cluster.cluster.endpoint
}

output "kubeconfig-certificate-authority-data" {
  value = data.aws_eks_cluster.cluster.certificate_authority.0.data
}

output "identity-oidc-issuer" {
  value = "${data.aws_eks_cluster.cluster.identity.0.oidc.0.issuer}"
}

provider "kubernetes" {
  version                = "~>1.10.0"
  host                   = data.aws_eks_cluster.cluster.endpoint
  cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
  token                  = data.aws_eks_cluster_auth.cluster.token
  load_config_file       = false
}

provider "helm" {
  version                = "~>1.0.0"
  debug = true
  alias = "my_helm"

  kubernetes {
    host = data.aws_eks_cluster.cluster.endpoint
    token = data.aws_eks_cluster_auth.cluster.token
    cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
    load_config_file = false
  }
}

data "helm_repository" "stable" {
  name = "stable"
  url  = "https://kubernetes-charts.storage.googleapis.com"
}

resource "helm_release" "mydatabase" {
  provider  = helm.my_helm
  name  = "mydatabase"
  chart = "stable/mariadb"
  namespace = "default"

  set {
    name  = "mariadbUser"
    value = "foo"
  }

  set {
    name  = "mariadbPassword"
    value = "qux"
  }
}

当我跑的时候

我看到一个

有什么想法吗?我也会欣赏一些如何调试这个问题的想法--调试选项不起作用。

我可以确认它与新创建的

集群

..。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66067458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档