小编Pie*_* A.的帖子

读取嵌入.NET程序集的数据

对于学校项目,我不允许使用存储过程来存储我的SQL脚本.为了解决这个问题,我试图在我的类程序集中创建一个SQL_scripts文件夹.

我的项目结构

现在我被困在如何从相对路径读取我的脚本?

在这里我尝试没有成功:

var appDomain = System.AppDomain.CurrentDomain;
                var basePath = appDomain.RelativeSearchPath ?? appDomain.BaseDirectory;
                string path = Path.Combine(basePath, "SQL_scriptes", "GetAllEmptyRoomsAtDateRange.sql");
                string query = File.ReadAllText(path);
Run Code Online (Sandbox Code Playgroud)

但我总是在以下文件夹中:

  • MyProject的\测试\ BIN \调试\ SQL_scriptes\GetAllEmptyRoomsAtDateRange.sql

任何的想法?

.net c# reflection dll

4
推荐指数
1
解决办法
449
查看次数

PHP session_start();

我正在尝试使用PHP的Sessions,我session_start();在我的开头使用它,index.php但得到以下错误消息:

警告:session_start()[function.session-start]:无法发送会话cookie - 已经在/home/ideal906/public_html/index.php中发送的输出(输出从/home/ideal906/public_html/index.php:1开始)在第2行

警告:session_start()[function.session-start]:无法发送会话缓存限制器 - 已在/home/ideal906/public_html/index.php中发送的标头(输出从/home/ideal906/public_html/index.php:1开始)在第2行

这很奇怪,这是我网站的第一行:

<?php
    session_start();
?>

<!DOCTYPE html>
<html>
    <head>
<meta charset="utf-8" />
        <meta name="author" content="Pierre Anken">
        <meta name="description" content="Outil de création de menus équlibrés selon vos besoins">
        <!--[if lt IE 9]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="jquery.js"></script>
        <script src="scripts.js"></script>
        <link rel="stylesheet" href="style.css" />
        <title>Composez vos menus</title>
    </head>
    <body>
        <section id='sectionCentre'>
            <div id='presentation'>
                <h2>Ideal Menu</h2>

            </div>
        </section>
        <section id='bandeauHautDoite'>
            <nav>
                <ul>
                    <a href='#' elementMenu='monCompte' id='monCompte'>Mon compte</a><br/>
                    <a href='#' elementMenu='mesMenus' id='mesMenus'>Mes menus</a><br/>
                    <a …
Run Code Online (Sandbox Code Playgroud)

php session

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

标签 统计

.net ×1

c# ×1

dll ×1

php ×1

reflection ×1

session ×1