winform下登陆web服务器(C#)
来源:百度知道 编辑:UC知道 时间:2024/06/14 21:15:27
假如我有个登陆页面接受用户名和密码参数实现登陆到系统.我想在winform下直接登陆到web 不用打开浏览器.
这样可以吗 希望高手指教下
用的是c#语言开发工具vs205 希望最好能贴上代码.谢谢
如果web服务代码也是你写的..那就很好办.
写一个web service
如果不是你的..那...
可以使用WebBrowser
看下面这个例子
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace AdaEniac
{
[System.Runtime.InteropServices.ComVisibleAttribute(true)]
public partial class frmNavigation : Form
{
public frmNavigation()
{
InitializeComponent();
}
private void frmNavigation_Load(object sender, EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
//定义网页地址
FileInfo fileNavigation = new FileInfo("Web/Notice.htm");
// WebBrowser控件显示的网页路径
webN