开发者

Generic Handler + UriBuilder

开发者 https://www.devze.com 2023-02-19 08:39 出处:网络
I\'m creating a Silverlight uploader using a generic handler and asp. The app runs, but when I try to deploy to the localhost server or the production server the app just doesn\'t work properly. I thi

I'm creating a Silverlight uploader using a generic handler and asp. The app runs, but when I try to deploy to the localhost server or the production server the app just doesn't work properly. I thing the problem is in the URI of the Generic Handler.

            //I THINK THE PROBLEM IS IN THIS LINE
            UriBuilder ub = new UriBuilder("http://localhost:3840/开发者_Python百科receiver.ashx");

            ub.Query = string.Format("filename={0}", fileName);
            WebClient c = new WebClient();
            c.OpenWriteCompleted += (sender, e) =>
            {
                PushData(data, e.Result);
                e.Result.Close();
                data.Close();
            };
            c.OpenWriteAsync(ub.Uri);

Which is the correct format of the generic handler url when I deploy the app to the server and how can I test the handler to check is everything is going ok?

Thanks


Use following 2 lines to define ub on your production server: (vb code) Dim u As Uri = New Uri(Application.Current.Host.Source, "../receiver.ashx") Dim ub As New UriBuilder(u.OriginalString)

0

精彩评论

暂无评论...
验证码 换一张
取 消