亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
123下一頁(yè)
最近訪問(wèn)板塊 發(fā)新帖
查看: 9242 | 回復(fù): 20
打印 上一主題 下一主題

用ASP.NET調(diào)用CL [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2009-05-18 16:01 |只看該作者 |倒序?yàn)g覽
最近公司要逐步把ERP轉(zhuǎn)形,用C#來(lái)顯示畫面,400進(jìn)行后臺(tái)數(shù)據(jù)處理,運(yùn)算~~

通過(guò)ASP.NET調(diào)用RPG,已經(jīng)實(shí)現(xiàn)了,但是調(diào)用CL一直也沒(méi)有眉目(ASP.NET是通過(guò)調(diào)用Program來(lái)調(diào)用RPG的)

想請(qǐng)教一下各位大俠,看看各位有沒(méi)有什么好的方法,謝謝大家!

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2009-05-19 08:43 |只看該作者
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2009-05-19 08:56 |只看該作者
謝謝mario663大俠的指導(dǎo)!
對(duì)于在AS400上建立PROCEDURE這個(gè)我還沒(méi)試過(guò),能否指點(diǎn)下.
(通過(guò)ASP.NET調(diào)用RPG,不用建PROCEDURE也可以調(diào)用.為何CL不行呢,想不明白,呵呵)
再次感謝!

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2009-05-19 09:25 |只看該作者
樓主,你怎么實(shí)現(xiàn)的C#調(diào)用RPG哈,
指點(diǎn)一下,謝謝

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2009-05-19 09:33 |只看該作者
樓主怎么實(shí)現(xiàn)ASP.NET調(diào)用RPG?代碼可否參考一下,想知道?
還有就是有沒(méi)有實(shí)現(xiàn)VB調(diào)用RPG的?請(qǐng)指點(diǎn)一下,非常感謝!

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2009-05-19 14:05 |只看該作者
怎么調(diào)用RPG, 我不大會(huì)說(shuō),我把代碼貼出來(lái)吧~大家一起討論下~~~
下面這段代碼是APP_CODE下面的~
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using cwbx; //引用iseries插件,// cwbx.dll is in the Iseries access folder C:\Program Files\IBM\Client Access\Shared

/// <summary>
/// AS400Program 的摘要描述
/// </summary>
//namespace Interfaces.Source

    public class AS400Program
    {
        private bool as400Configured = false;
        public cwbx.AS400System as400;
        public cwbx.Program program;

        // configuration format:
        // as400;userid;password;library;program
        public AS400Program(string configuration)
        {
            if (!as400Configured)
            {
                string[] settings = configuration.Split(';');
                if (settings.Length == 5)
                {
                    as400 = new cwbx.AS400SystemClass();  // creates an as/400 object
                    program = new cwbx.Program(); // Create a program object
                    as400.Define(settings[0]); // IP of AS/400
                    program.system = as400;
                    program.system.UserID = settings[1]; // Your user name
                    program.system.Password = settings[2]; // Your password
                    program.LibraryName = settings[3]; //Library where your program is located
                    program.ProgramName = settings[4]; // Program that this app will call
                    as400Configured = true;
                }
                else
                {
                    throw (new Exception(
                        string.Format("Invalid AS400Program configuration string : [{0}]", configuration)));
                }
            }
        }

        public bool Invoke(bool throwInsteadOfReturn, ref cwbx.ProgramParameters parameters)
        {
            bool success = false;

            try
            {
                if (as400.IsConnected(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd) == 0)
                {
                    //  Lost connection with the AS400.  Disconnect, then reconnect.
                    as400.Disconnect(cwbx.cwbcoServiceEnum.cwbcoServiceAll);
                    as400.Connect(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd);

                    if (as400.IsConnected(cwbx.cwbcoServiceEnum.cwbcoServiceRemoteCmd) == 0)
                    {
                        //  Log something here.
                    }
                }

                //program.Call(parameters);
                cwbx.ProgramParameters para = new cwbx.ProgramParametersClass();
                program.Call(para);
                success = true;
            }
            catch (Exception e)
            {
                // Capture to log the errors but then re-throw it to let caller know there was trouble.
                if (as400.Errors.Count > 0)
                {
                    foreach (cwbx.Error error in as400.Errors)
                    {
                        //  Log something here.
                    }
                }

                if (program.Errors.Count > 0)
                {
                    foreach (cwbx.Error error in program.Errors)
                    {
                        //  Log something here.
                    }
                }

                if (throwInsteadOfReturn)
                {
                    throw (e);
                }
            }

            return (success);
        }

        public void Close()
        {
            as400.Disconnect(cwbx.cwbcoServiceEnum.cwbcoServiceAll);
        }
    }

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2009-05-19 14:09 |只看該作者
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Reflection;


    public partial class UsingAS400Program : System.Web.UI.Page
    {
        //protected enum DataLengths : int

        protected enum DataLengths : int
        {
            UserId = 7, //定義UserId長(zhǎng)度為7
            UserName = 10,//定義UserName長(zhǎng)度為10
        }


        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public string CALLAS400()
        {
            //  Assume the RPG program being called takes one input paramater, UserId, and returns the UserName.

            //從web.config中去讀取  partsPricingConfig 的值,並傳遞給 AS400Program.cs 中的 AS400Program();
            AS400Program program = new AS400Program(System.Configuration.ConfigurationManager.AppSettings["partsPricingConfig"]);


            cwbx.StringConverter stringConverter = new cwbx.StringConverterClass();
            cwbx.PackedConverter packedConverter = new cwbx.PackedConverterClass();
            //packedConverter.DecimalPosition = 4;
            //packedConverter.Digits = (int)DataLengths.UserName;

            cwbx.ProgramParameters parameters = new cwbx.ProgramParametersClass();

            //傳遞參數(shù)給as400
            parameters.Append("PEMN", cwbx.cwbrcParameterTypeEnum.cwbrcInput, (int)DataLengths.UserId);
            parameters["PEMN"].Value = stringConverter.ToBytes("2060113");

            parameters.Append("NAME", cwbx.cwbrcParameterTypeEnum.cwbrcInput, (int)DataLengths.UserName);
            parameters["NAME"].Value = stringConverter.ToBytes("aaabbbb");

            //調(diào)用 AS400Program.cs 中的 傳遞parameters 給 Invoke 調(diào)用AS400 中的 Program
            program.Invoke(true, ref parameters);

            //string price = packedConverter.FromBytes(parameters["UserName"].Value);

            //調(diào)用完成後關(guān)閉連結(jié)
            program.Close();

            return "恭喜你,調(diào)用成功!!";
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string aa = CALLAS400();

            TextBox1.Text = aa.ToString();
        }
}

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2009-05-19 14:12 |只看該作者
<?xml version="1.0"?>
<!--
    注意: 除了手動(dòng)編輯這個(gè)檔案以外,您也可以使用
    Web 管理工具設(shè)定您的應(yīng)用程式設(shè)定值。請(qǐng)使用
    Visual Studio 中的 [網(wǎng)站] -> [ASP.NET 組態(tài)] 選項(xiàng)。
    如需完整的設(shè)定與註解清單,請(qǐng)參考
    machine.config.comments (通常位於
    \Windows\Microsoft.Net\Framework\v2.x\Config)
-->
<configuration>
  <appSettings>
    <!--以下定義連結(jié)AS400的參數(shù):value="value="server;userid;password;library;program"-->
    <!--<add key="partsPricingConfig" value="10.81.1.14;pgma04;pgma04;TPCLIBA;NETTEST1"/>-->
    <add key="partsPricingConfig" value="10.81.1.14;pgma04;pgma04;TPCLIBA;SFRE86"/>
  </appSettings>
        <connectionStrings/>
        <system.web>
                <!--
            設(shè)定 compilation debug="true" 會(huì)將偵錯(cuò)
            符號(hào)插入編譯過(guò)的頁(yè)面。因?yàn)檫@樣會(huì)
            影響效能,所以只有在開發(fā)期間才能將
            這個(gè)值設(shè)定為 true。
        -->
                <compilation debug="true"/>
                <!--
            <authentication> 區(qū)段可以用來(lái)設(shè)定 ASP.NET
            使用的安全性驗(yàn)證模式,以識(shí)別連入的
            使用者。
        -->
                <authentication mode="Windows"/>
                <!--
            <customErrors> 區(qū)段可以用來(lái)設(shè)定
            在執(zhí)行要求期間發(fā)生未處理
            錯(cuò)誤時(shí)所要執(zhí)行的動(dòng)作。具體來(lái)說(shuō),
            它可以讓開發(fā)人員設(shè)定要顯示的 HTML 錯(cuò)誤網(wǎng)頁(yè),
            以取代錯(cuò)誤堆疊追蹤。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        </system.web>
</configuration>

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2009-05-19 14:14 |只看該作者
所有的連接代碼就在上面,不知道能不能看懂,有點(diǎn)亂~~~我也不知道該怎么說(shuō)

實(shí)現(xiàn)的功能就是:通過(guò)一個(gè)BOTTON執(zhí)行400里的一個(gè)RPG~~~(連接的RPG在最后發(fā)的那段代碼上)

如果有不明白的,可以留言~~~

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2009-05-19 14:15 |只看該作者
VB我沒(méi)用過(guò),不好意思~~~
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP