在业务层上课需要上传文件 [英] In business layer class need to upload files

查看:79
本文介绍了在业务层上课需要上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在前端有ASP页面,并且有一个执行某些逻辑的业务层类.

从ASP页面,我将文件名传递给必须上传到服务器的类.该业务层类必须将此任务交给线程进行上传.

在本课程中,我如何上传文件.


请帮助我,

I''m having the ASP page in front end and a business layer class to perform some logic.

from asp page i will pass the file name to class whjch has to upload to server. this business layer class has to give this task to a thread for uploading.

in this class how can i upload the files.


Please help me,

推荐答案

听起来像您并不完全了解分层体系结构的工作原理.

对于三层体系结构:
有一个UI层
创建一个类库-BusinessLogic
创建一个类库-DataAccess

现在,从您的UI,使用对象模型并传递给BusinessLogic项目类.此类是业务逻辑类.在此处根据您的需要进行更改.
现在,将更改后的数据从业务逻辑类传递到dataAccess项目类.在此类中,使用ADO.NET并将所需的值传递给存储过程.

为了获取数据,数据将从DA传输到BL层,然后再从BL传输到UI层.
看看这些,用示例进行解释:
C#中的3层体系结构 [ 3-层架构示例 [使用C#的ASP.NET中的3层体系结构 [
Sounds like you are not totally aware of how a layered architecture works.

For 3-tier architecture:
Have a UI layer
Create a class library - BusinessLogic
Create a class library - DataAccess

Now, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class. In this class, use ADO.NET and pass on the needed values to Stored Procedure.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.
Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]

For uploading, you will upload file from UI only... pass it to DB using BL.


这篇关于在业务层上课需要上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆