1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
|
<Type Name="WebClient" FullName="System.Net.WebClient" FullNameSP="System_Net_WebClient" Maintainer="ecma">
<TypeSignature Language="ILASM" Value=".class public sealed WebClient extends System.MarshalByRefObject" />
<TypeSignature Language="C#" Value="public sealed class WebClient : MarshalByRefObject" />
<MemberOfLibrary>Networking</MemberOfLibrary>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
<AssemblyVersion>1.0.x.x</AssemblyVersion>
<AssemblyCulture>none</AssemblyCulture>
<Attributes>
<Attribute>
<AttributeName>CLSCompliantAttribute(true)</AttributeName>
<Excluded>0</Excluded>
</Attribute>
</Attributes>
</AssemblyInfo>
<ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
<Docs>
<summary>
<para> Provides common methods for sending data to
and receiving data from a resource identified by a URI.</para>
</summary>
<remarks>
<block subset="none" type="note">
<para>The <see cref="T:System.Net.WebClient" />
class provides common methods for
sending data to or receiving data from any local, Intranet, or Internet resource identified by
a URI. </para>
<para>The <see cref="T:System.Net.WebClient" /> class uses the <see cref="T:System.Net.WebRequest" /> class to provide access to Internet
resources. <see cref="T:System.Net.WebClient" /> instances can
access data with any class derived from <see cref="T:System.Net.WebRequest" /> that is
registered with the <see cref="M:System.Net.WebRequest.RegisterPrefix(System.String,System.Net.IWebRequestCreate)" qualify="true" />
method. </para>
<para> By default, the CLI supports URIs
with the "http:", "https:", and "file:"
schemes.</para>
<para>The <see cref="T:System.Net.WebClient" /> class provides the following methods for uploading data to
a resource. </para>
<list type="bullet">
<item>
<term>
<see cref="M:System.Net.WebClient.OpenWrite(System.String)" /> sends a <see cref="T:System.IO.Stream" /> to the server hosting a
resource.</term>
</item>
<item>
<term>
<see cref="M:System.Net.WebClient.UploadData(System.String,System.Byte[])" /> sends a byte array to the server hosting
a resource and returns a byte array containing the response from the server,
if any.</term>
</item>
<item>
<term>
<see cref="M:System.Net.WebClient.UploadFile(System.String,System.String)" /> sends a local file to the server
hosting a resource and returns a byte array containing the response from the
server, if any.</term>
</item>
<item>
<term>
<see cref="M:System.Net.WebClient.UploadValues(System.String,System.Collections.Specialized.NameValueCollection)" /> sends a <see cref="T:System.Collections.Specialized.NameValueCollection" />
collection to the server hosting a resource and returns a byte array containing the response from the server,
if any.</term>
</item>
</list>
<para>The <see cref="T:System.Net.WebClient" /> class also provides the following methods for
downloading data from a resource.</para>
<list type="bullet">
<item>
<term>
<see cref="M:System.Net.WebClient.DownloadData(System.String)" /> downloads data from a resource and
returns a byte array.</term>
</item>
<item>
<term>
<see cref="M:System.Net.WebClient.DownloadFile(System.String,System.String)" /> downloads data from a resource to a
local file.</term>
</item>
<item>
<term>
<see cref="M:System.Net.WebClient.OpenRead(System.String)" /> returns the data from the resource as a
<see cref="T:System.IO.Stream" />.</term>
</item>
</list>
</block>
</remarks>
</Docs>
<Base>
<BaseTypeName>System.MarshalByRefObject</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
<Excluded>0</Excluded>
</Interface>
</Interfaces>
<Attributes />
<Members>
<Member MemberName="DownloadData">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] DownloadData(string address)" />
<MemberSignature Language="C#" Value="public byte[] DownloadData(string address);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para>Downloads data from the resource identified by the
specified URI.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI from which data will be downloaded.</param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing the data downloaded from the resource
specified by <paramref name="address" />.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>An error occurred while downloading data.</para>
</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="DownloadFile">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance void DownloadFile(string address, string fileName)" />
<MemberSignature Language="C#" Value="public void DownloadFile(string address, string fileName);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="fileName" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para> Downloads data from the resource identified by
the specified URI, and writes the data to the specified file .</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI from which data will be downloaded.</param>
<param name=" fileName">A <see cref="T:System.String" /> that specifies the name of the local file to which data will be written.</param>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para>-or-</para>
<para>
<paramref name="filename" /> is <see langword="null" /> or <see cref="F:System.String.Empty" /> or contains invalid characters, or the specified path to the file does not exist.</para>
<para>-or-</para>
<para>An error occurred while downloading data.</para>
</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have permission to write to local files.</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>This method downloads data from the absolute URI
to local file, <paramref name="fileName" /> . If <paramref name="fileName " />already exists,
the existing file is overwritten.</para>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to write to files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Write" qualify="true" />.</permission>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="OpenRead">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.IO.Stream OpenRead(string address)" />
<MemberSignature Language="C#" Value="public Stream OpenRead(string address);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para>Opens a readable <see cref="T:System.IO.Stream" /> containing the data downloaded from the resource identified
by the specified URI.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI from which data will be downloaded.</param>
<returns>
<para> A <see cref="T:System.IO.Stream" /> used to read data from
a resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>An error occurred while downloading data.</para>
</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>
<block subset="none" type="note">This method creates a <see cref="T:System.IO.Stream" /> instance used to access the data specified by the absolute URI
<paramref name="." /> The caller of this method is responsible for calling <see cref="M:System.IO.Stream.Close" /> to
release the resources allocated for the stream.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="OpenWrite">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.IO.Stream OpenWrite(string address)" />
<MemberSignature Language="C#" Value="public Stream OpenWrite(string address);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para> Opens a <see cref="T:System.IO.Stream" /> for writing data to the resource identified by the specified URI.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI to receive the data.</param>
<returns>
<para> A <see cref="T:System.IO.Stream" /> used to write data to the resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>An error occurred while opening the stream.</para>
</exception>
<remarks>
<para>This method is equivalent to <see cref="M:System.Net.WebClient.OpenWrite(System.String)" />(<paramref name="address" />, "POST").</para>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>
<block subset="none" type="note">The underlying request is
made with the POST method.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="OpenWrite">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.IO.Stream OpenWrite(string address, string method)" />
<MemberSignature Language="C#" Value="public Stream OpenWrite(string address, string method);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="method" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para> Opens a <see cref="T:System.IO.Stream" /> for writing data to the resource identified by the specified URI using the
specified protocol method.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the data.</param>
<param name=" method">A <see cref="T:System.String" /> that specifies the protocol method used to send the data to the resource identified by <paramref name="address" /> .</param>
<returns>
<para> A <see cref="T:System.IO.Stream" /> used to write data to the resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>An error occurred while opening the stream.</para>
</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<block subset="none" type="note">
<para> This method returns a writable stream
that is used to send data to a resource. The underlying request is made
with the protocol method specified by <paramref name="method" /> . For more information
about protocol methods, see <see cref="P:System.Net.WebRequest.Method" qualify="true" /> .</para>
<para>If the <paramref name="method" /> parameter specifies a method that is not recognized by
the server, the underlying protocol classes determine what occurs. Typically, a
<see cref="T:System.Net.WebException" />
is thrown with the <see cref="P:System.Net.WebException.Status" /> property set to indicate the error.</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadData">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadData(string address, class System.Byte[] data)" />
<MemberSignature Language="C#" Value="public byte[] UploadData(string address, byte[] data);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="data" Type="System.Byte[]" />
</Parameters>
<Docs>
<summary>
<para> Uploads the specified data to the resource
identified by the specified
URI.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the data.</param>
<param name=" data">A <see cref="T:System.Byte" /> array containing data to send to the resource.</param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing
the body of the response, if any, from the server hosting the
resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="data" /> is <see langword="null" />.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the data.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
</exception>
<remarks>
<para>This method is equivalent to <see cref="M:System.Net.WebClient.UploadData(System.String,System.Byte[])" />
(<paramref name="address" />, "POST", <paramref name="data" />).</para>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<block subset="none" type="note">
<para>This method sends a data buffer to a
resource. The underlying request is
made using the POST method. </para>
<para> This method does not encode the contents of <paramref name="data" /> before uploading
it to the resource.</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadData">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadData(string address, string method, class System.Byte[] data)" />
<MemberSignature Language="C#" Value="public byte[] UploadData(string address, string method, byte[] data);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="data" Type="System.Byte[]" />
</Parameters>
<Docs>
<summary>
<para> Uploads the specified data to the resource identified by the specified
URI using the specified protocol method.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the data.</param>
<param name="method">
<para>A <see cref="T:System.String" /> that specifies the protocol method used to send the data to the resource identified by <paramref name="address" /> .</para>
</param>
<param name=" data">A <see cref="T:System.Byte" /> array containing data to send to the resource.</param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing the body of
the response, if any, from the server hosting the
resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="data" /> is <see langword="null" />.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the data.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<block subset="none" type="note">
<para> For more information about protocol
methods, see <see cref="P:System.Net.WebRequest.Method" qualify="true" />
. </para>
<para> This method does not encode the contents of <paramref name="data" /> before uploading
it to the resource.</para>
<para> If <paramref name="method" /> specifies a method that is not recognized by
the server, the underlying protocol classes determine what occurs. Typically, a
<see cref="T:System.Net.WebException" />
is thrown with the <see cref="P:System.Net.WebException.Status" /> property set to indicate the error.</para>
</block>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadFile">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadFile(string address, string fileName)" />
<MemberSignature Language="C#" Value="public byte[] UploadFile(string address, string fileName);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="fileName" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para> Uploads the specified local file to the resource
identified by the specified
URI.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the file.</param>
<param name="fileName">A <see cref="T:System.String" /> that specifies the file to send to the resource.</param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing the body of the response, if any, from the server hosting the
resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="filename" /> is <see langword="null" /> or <see cref="F:System.String.Empty" /> or contains invalid characters, or the specified path to the file does not exist.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the file.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
<para>-or-</para>
<para>The Content-Type header begins with "multipart".</para>
</exception>
<exception cref="T:System.Security.SecurityException">Local file access has not been granted.</exception>
<remarks>
<para>This method is equivalent to <see cref="M:System.Net.WebClient.UploadFile(System.String,System.String)" /> (<paramref name="address" />, "POST",
<paramref name="filename" />).</para>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>
<block subset="none" type="note">This method sends a local file to a
resource. The underlying request is
made using the POST method.</block>
</para>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to access path information and read files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.PathDiscovery" /> and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" />.</permission>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadFile">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadFile(string address, string method, string fileName)" />
<MemberSignature Language="C#" Value="public byte[] UploadFile(string address, string method, string fileName);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="fileName" Type="System.String" />
</Parameters>
<Docs>
<summary>
<para>Uploads the specified local file using the specified protocol
method to the resource identified by the specified URI .</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the file.</param>
<param name="method">
<para>A <see cref="T:System.String" /> that specifies the protocol method used to send the data to the resource identified by <paramref name="address" /> .</para>
</param>
<param name="fileName">A <see cref="T:System.String" /> that specifies the file to send to the resource.</param>
<returns>
<para>A <see cref="T:System.Byte" /> array containing the body of
the response, if any, from the server hosting the resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="filename" /> is <see langword="null" /> or <see cref="F:System.String.Empty" /> or contains invalid characters, or the specified path to the file does not exist.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the file.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
<para>-or-</para>
<para>The Content-Type header begins with "multipart".</para>
</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have the required permissions.</exception>
<remarks>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<block subset="none" type="note">
<para> For more information about protocol
methods, see <see cref="P:System.Net.WebRequest.Method" qualify="true" />
. </para>
<para> If <paramref name="method" /> specifies a protocol method that is not recognized by
the server, the underlying protocol classes determine what occurs. Typically, a
<see cref="T:System.Net.WebException" />
is thrown with the <see cref="P:System.Net.WebException.Status" /> property set to indicate the error.</para>
</block>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">Requires permission to access path information and read files. See <see cref="F:System.Security.Permissions.FileIOPermissionAccess.PathDiscovery" /> and <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" />.</permission>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadValues">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadValues(string address, class System.Collections.Specialized.NameValueCollection data)" />
<MemberSignature Language="C#" Value="public byte[] UploadValues(string address, NameValueCollection data);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="data" Type="System.Collections.Specialized.NameValueCollection" />
</Parameters>
<Docs>
<summary>
<para> Uploads the specified name/value collection
to the specified resource.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the collection <paramref name="data" /> .</param>
<param name="data">The <see cref="T:System.Collections.Specialized.NameValueCollection" /> to send to the resource identified by <paramref name="address" /> .</param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing the body of the response, if any, from the server hosting the
resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="data" /> is <see langword="null" />.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the data.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
<para>-or-</para>
<para>The Content-Type header is not <see langword="null" />, and is not "application/x-www-form-urlencoded".</para>
</exception>
<remarks>
<para>This method is equivalent to <see cref="M:System.Net.WebClient.UploadValues(System.String,System.Collections.Specialized.NameValueCollection)" /> (<paramref name="address" />, "POST",
<paramref name="data" />).</para>
<para>If the Content-Type header is <see langword="null" />, this method sets it to
"application/x-www-form-urlencoded".</para>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>
<block subset="none" type="note">The underlying
request is made using the POST method. </block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="UploadValues">
<MemberSignature Language="ILASM" Value=".method public hidebysig instance class System.Byte[] UploadValues(string address, string method, class System.Collections.Specialized.NameValueCollection data)" />
<MemberSignature Language="C#" Value="public byte[] UploadValues(string address, string method, NameValueCollection data);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Byte[]</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="address" Type="System.String" />
<Parameter Name="method" Type="System.String" />
<Parameter Name="data" Type="System.Collections.Specialized.NameValueCollection" />
</Parameters>
<Docs>
<summary>
<para> Uploads the specified name/value collection
to the specified resource using the specified method.</para>
</summary>
<param name="address">A <see cref="T:System.String" /> that specifies the URI of the resource to receive the collection <paramref name="data" /> . </param>
<param name="method">A <see cref="T:System.String" /> that specifies the protocol method used to send <paramref name="data" /> to the resource.</param>
<param name="data">The <see cref="T:System.Collections.Specialized.NameValueCollection" /> to send to the resource identified by <paramref name="address" /> . </param>
<returns>
<para> A <see cref="T:System.Byte" /> array containing the body of the response, if any, from the server hosting the
resource.</para>
</returns>
<exception cref="T:System.Net.WebException">
<para>The absolute URI is not valid.</para>
<para> -or-</para>
<para>
<paramref name="data" /> is <see langword="null" />.</para>
<para>-or-</para>
<para>An error occurred while opening the stream or uploading the data.</para>
<para>-or-</para>
<para>There was no response from the server hosting the resource.</para>
<para>-or-</para>
<para>The Content-Type header is not <see langword="null" />, and is not "application/x-www-form-urlencoded".</para>
</exception>
<remarks>
<para>If the Content-Type header is <see langword="null" />, this method sets it to "application/x-www-form-urlencoded". </para>
<para>If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is not
<see cref="F:System.String.Empty" />, <paramref name="address" /> is combined
with <see cref="P:System.Net.WebClient.BaseAddress" /> to form the absolute URI of the requested
data. If the <see cref="P:System.Net.WebClient.BaseAddress" /> property of the current instance is
<see cref="F:System.String.Empty" />,
<paramref name="address" /> is required to be the absolute URI of the requested data. If
the <see cref="P:System.Net.WebClient.QueryString" />
property of the current instance is not <see cref="F:System.String.Empty" />, it is
appended to <paramref name="address" />.</para>
<para>
<block subset="none" type="note">If <paramref name="method" /> specifies a protocol
method that is not recognized by the server, the underlying protocol classes
determine what occurs. Typically, a <see cref="T:System.Net.WebException" /> is thrown with the <see cref="P:System.Net.WebException.Status" />
property set to indicate the error.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" />
<MemberSignature Language="C#" Value="public WebClient();" />
<MemberType>Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs>
<summary>
<para>Constructs a new instance of the <see cref="T:System.Net.WebClient" /> class.</para>
</summary>
<remarks>
<para> This constructor creates a new instance of the
<see cref="T:System.Net.WebClient" />
class with properties set to <see langword="null" />.</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="BaseAddress">
<MemberSignature Language="ILASM" Value=".property string BaseAddress { public hidebysig specialname instance string get_BaseAddress() public hidebysig specialname instance void set_BaseAddress(string value) }" />
<MemberSignature Language="C#" Value="public string BaseAddress { get; set; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Gets or sets the base URI for requests made by a <see cref="T:System.Net.WebClient" /> .</para>
</summary>
<value>
<para> A <see cref="T:System.String" /> containing the base URI for requests made by a
<see cref="T:System.Net.WebClient" /> or, <see cref="F:System.String.Empty" />, if no value
was set or <see langword="null" /> was specified for a set operation. </para>
</value>
<exception cref="T:System.ArgumentException">The value specified for a set operation is not <see langword="null" /> or <see cref="F:System.String.Empty" />, and is not a URI in a format recognized by the <see cref="T:System.Uri" /> class.</exception>
<remarks>
<para>
<block subset="none" type="note">The <see cref="P:System.Net.WebClient.BaseAddress" /> property
contains a base URI that is combined with the relative address specified when
calling an upload or download method.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Credentials">
<MemberSignature Language="ILASM" Value=".property class System.Net.ICredentials Credentials { public hidebysig specialname instance class System.Net.ICredentials get_Credentials() public hidebysig specialname instance void set_Credentials(class System.Net.ICredentials value) }" />
<MemberSignature Language="C#" Value="public ICredentials Credentials { get; set; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Net.ICredentials</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para> Gets or sets the network credentials used
to authenticate the client making the current request.</para>
</summary>
<value>
<para> A <see cref="T:System.Net.ICredentials" /> containing the authentication credentials for the
request. The default is
<see langword="null" />.</para>
</value>
<remarks>
<para>The <see cref="P:System.Net.WebClient.Credentials" /> property contains the
authentication credentials required to access the Internet resource.</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="Headers">
<MemberSignature Language="ILASM" Value=".property class System.Net.WebHeaderCollection Headers { public hidebysig specialname instance class System.Net.WebHeaderCollection get_Headers() public hidebysig specialname instance void set_Headers(class System.Net.WebHeaderCollection value) }" />
<MemberSignature Language="C#" Value="public WebHeaderCollection Headers { get; set; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Net.WebHeaderCollection</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Gets or sets a collection of header name/value pairs
associated with the request.</para>
</summary>
<value>
<para> A <see cref="T:System.Net.WebHeaderCollection" /> containing header
name/value pairs associated with the request or, if this property has not been
set or was set to <see langword="null" />, a new instance of the <see cref="T:System.Net.WebHeaderCollection" />
class.</para>
</value>
<remarks>
<para>
<block subset="none" type="note">This property
stores the header information that the current instance sends with a
request. This is an unrestricted collection of headers; setting headers that are
protected in <see cref="T:System.Net.WebRequest" /> descendants like <see cref="T:System.Net.HttpWebRequest" /> is allowed.</block>
</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="QueryString">
<MemberSignature Language="ILASM" Value=".property class System.Collections.Specialized.NameValueCollection QueryString { public hidebysig specialname instance class System.Collections.Specialized.NameValueCollection get_QueryString() public hidebysig specialname instance void set_QueryString(class System.Collections.Specialized.NameValueCollection value) }" />
<MemberSignature Language="C#" Value="public NameValueCollection QueryString { get; set; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Collections.Specialized.NameValueCollection</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para>Gets or sets a collection of query name/value pairs
associated with the request.</para>
</summary>
<value>
<para> A <see cref="T:System.Collections.Specialized.NameValueCollection" /> that contains query name/value
pairs associated with the request or, if this property has not been
set or was set to <see langword="null" />, a new instance of the <see cref="T:System.Collections.Specialized.NameValueCollection" />
class.</para>
</value>
<remarks>
<para>The <see cref="P:System.Net.WebClient.QueryString" /> property contains a <see cref="T:System.Collections.Specialized.NameValueCollection" />
instance containing name/value pairs that are appended to
the URI as a query string. The contents of the <see cref="P:System.Net.WebClient.QueryString" /> property are preceded by a question mark
(?), and each name/value pair is separated by an ampersand (&).</para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
<Member MemberName="ResponseHeaders">
<MemberSignature Language="ILASM" Value=".property class System.Net.WebHeaderCollection ResponseHeaders { public hidebysig specialname instance class System.Net.WebHeaderCollection get_ResponseHeaders() }" />
<MemberSignature Language="C#" Value="public WebHeaderCollection ResponseHeaders { get; }" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.Net.WebHeaderCollection</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
<para> Gets a collection of header name/value pairs
associated with the response.</para>
</summary>
<value>
<para> A <see cref="T:System.Net.WebHeaderCollection" /> containing header name/value
pairs associated with the response.</para>
</value>
<remarks>
<para>This property is read-only.</para>
<para>The <see cref="P:System.Net.WebClient.ResponseHeaders" /> property contains a <see cref="T:System.Net.WebHeaderCollection" />
instance containing header information the <see cref="T:System.Net.WebClient" /> receives from the Internet
resource. </para>
</remarks>
</Docs>
<Excluded>0</Excluded>
</Member>
</Members>
<TypeExcluded>0</TypeExcluded>
</Type>
|