惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - greystar

LightSwitch OOB发布模式下 Title的处理 个性化lightswitch登录屏幕(附源码) LightSwitch登录界面如何设置背景 LightSwitch学习阶段疑难问答 使用 OfficeIntegration.Word 实现lightswitch导出WORD的功能(续) 使用 OfficeIntegration.Word 实现lightswitch导出WORD的功能 lightswitch如何实现文件批量上传功能 lightswitch自定义扩展实现示例教程 lightswitch中自动完成框与查询参数的联动效果 如何在LightSwitch中创建多栏自动完成的下拉框 自定义lightswitch主屏幕 SQL Server 2008中的MERGE(不仅仅是合并) 一段XSLT转换XML节点名的测试代码 SL相关的感想 使用LINQ取得已选中的CheckBox Batch Updating in Entity Framework 利用Register protocol实现网页调用桌面程序 路径标记语法 邮件合并中图片字段的处理
devexpress套餐中UploadControl实现自定义参数传递的例子
greystar · 2011-10-28 · via 博客园 - greystar
 

 public partial class MainPage : UserControl {
        public MainPage() {
            InitializeComponent();
            uploadControl.UserID = 1112;
        }
    }
    public class CustomUploadControl : UploadControl {
        public int UserID {
            get { return ((CustomUploader)Uploader).UserID; }
            set { ((CustomUploader)Uploader).UserID = value; }
        }

        protected override Uploader CreateUploader() {
            return new CustomUploader(Dispatcher);
        }
    }
    class CustomUploader : Uploader {
        public CustomUploader(Dispatcher dispatcher) : base(dispatcher) { }

        public int UserID {
            get { return ((CustomUploadService)UploadService).UserID; }
            set { ((CustomUploadService)UploadService).UserID = value; }
        }

        protected override IUploadService CreateUploadService() {
            return new CustomUploadService(Dispatcher);
        }
    }
    class CustomUploadService : HttpWebRequestUploadService {
        public CustomUploadService(Dispatcher dispatcher) : base(dispatcher) { }

        public int UserID { get; set; }

        protected override Uri PrepareAddress() {
            string uri = string.Format("{0}&userID={1}", base.PrepareAddress().AbsoluteUri, UserID);
            return new Uri(uri, UriKind.Absolute);
        }
    }

页面如下:

 <Grid x:Name="LayoutRoot" Background="White">
        <local:CustomUploadControl
            x:Name="uploadControl" Width="532" Background="White"
            MaxFileSize="1000000" MaxUploadSize="3000000" MaxFileCount="5"
            FileNameFilter="Image files (*.jpg;*.jpeg;*.png;*.bmp;*.tif;*.tiff;*.gif)|*.jpg;*.jpeg;*.png;*.bmp;*.tif;*.tiff;*.gif"
            WebHandlerUri="http://localhost:1000/UploadHandler.ashx" UploadServerPath="Data"/>
    </Grid>