有没有办法从c#应用程序连接到Magento数据库?
发布时间:2020-12-15 22:22:43 所属栏目:百科 来源:网络整理
导读:我想构建一个使用c#访问(读/写)magento数据库的应用程序.我想知道有没有办法从自定义应用程序连接?如果是,哪个会是最好的?请建议我,因为我是Magento的新手,谢谢. 解决方法 您可以使用magento API执行此操作,下面的代码可能会对您有所帮助; using Magento_I
|
我想构建一个使用c#访问(读/写)magento数据库的应用程序.我想知道有没有办法从自定义应用程序连接?如果是,哪个会是最好的?请建议我,因为我是Magento的新手,谢谢.
解决方法
您可以使用magento API执行此操作,下面的代码可能会对您有所帮助;
using Magento_Import.MagentoAPI;
namespace Magento_Import
{
public partial class _Default : System.Web.UI.Page
{
Mage_Api_Model_Server_V2_HandlerPortTypeClient handler = new Mage_Api_Model_Server_V2_HandlerPortTypeClient();
protected void Page_Load(object sender,EventArgs e)
{
string session = handler.login("username","password");
catalogProductEntity[] products;
handler.catalogProductList(out products,session,null,null);
}
}
}
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
