C# 将PHP中的代码转换为C
什么是php中C等价的include函数?我必须将php中的以下代码转换为CC# 将PHP中的代码转换为C,c#,php,include,C#,Php,Include,什么是php中C等价的include函数?我必须将php中的以下代码转换为C if (file == "") file = str_replace(" ", "", family).strtolower(style) + " +ok sir php"; if (defined("FPDF_FONTPATH")) file = FPDF_FONTPATH + file; include(file); 在C语言中没有等价物-您不能动态地将文件包含到源代码中 在C中重用代码的方法是使用控件。当您询问
if (file == "") file = str_replace(" ", "", family).strtolower(style) + " +ok sir php";
if (defined("FPDF_FONTPATH"))
file = FPDF_FONTPATH + file;
include(file);
在C语言中没有等价物-您不能动态地将文件包含到源代码中
在C中重用代码的方法是使用控件。当您询问PHP时,我假设您指的是ASP.NET,而不是Winforms或WPF,因此您需要创建可在网站中重用的文件。在C语言中没有等效文件-您无法在源代码中动态包含文件
在C中重用代码的方法是使用控件。当您询问PHP时,我假设您指的是ASP.NET,而不是Winforms或WPF,因此您需要创建可以在网站中重用的代码。我使用的一些代码包括来自其他服务器的菜单文件
if (Application["menu"] != null)
{
litMenu.Text = Application["menu"].ToString();
}
else
{
try
{
System.Net.WebRequest wrq = System.Net.WebRequest.Create(ConfigurationManager.AppSettings["MenuPath"]);
System.Net.WebResponse wrp = wrq.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(wrp.GetResponseStream());
litMenu.Text = sr.ReadToEnd();
Application["menu"] = litMenu.Text;
}
catch
{
Application["menu"] = litMenu.Text;
}
}
我们的目标是使我们的IntranetPHP和management backendASP.NET看起来像同一个系统。我使用的一些代码包括来自另一台服务器的菜单文件
if (Application["menu"] != null)
{
litMenu.Text = Application["menu"].ToString();
}
else
{
try
{
System.Net.WebRequest wrq = System.Net.WebRequest.Create(ConfigurationManager.AppSettings["MenuPath"]);
System.Net.WebResponse wrp = wrq.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(wrp.GetResponseStream());
litMenu.Text = sr.ReadToEnd();
Application["menu"] = litMenu.Text;
}
catch
{
Application["menu"] = litMenu.Text;
}
}
我们的目标是使我们的IntranetPHP和management backendASP.NET看起来像同一个系统。恐怕唯一的解决方案是徒手操作。恐怕唯一的解决方案是徒手操作