将数据发送到网页 [英] Send data to web page
问题描述
大家好。
我需要你帮忙解决这个问题。
我需要发送数据从我的应用程序窗体C#到网页的文本框ASP.NET
数据是手动输入的,或者是在网页的文本框中使用扫描仪输入的,但是我需要添加各种数据。
我不是网页的所有者,也不能访问代码或数据库。
这就是我需要使用外部应用程序的原因。
我看到任何使用示例使用Sendkeys发送流程但不适合我:
请你能帮助我...... !
DS
我的尝试:
Hello guys.
I need you help with this issue.
I need send data from my application windows form C# to a text box of a web page ASP.NET
The data are input manually or with a scanner in the Textbox of web page, but I need add various data.
I not owner of web page and not access to the code or database.
That's why I need to do it with an external application.
I see any examples of use Send Process with Sendkeys but not function for me:
Please can you help me...!
DS
What I have tried:
<pre>public int Process(string Name) {
string NomProcess;
System.Diagnostics.Process[] Process1 = System.Diagnostics.Process.GetProcesses();
System.Diagnostics.Process[] Process2 = System.Diagnostics.Process.GetProcesses();
int ct1;
for (ct1 = 0; (ct1 <= Process2.GetUpperBound(0)); ct1++) {
NomProcess = Process2[ct1].MainWindowTitle;
if ((Name== NomProcess)) {
return Process2[ct1].Id;
}
}
}
private void Btn_ProcessNP_Click(object sender, System.EventArgs e) {
object ReturnValue;
int x = 0;
ReturnValue = Process("ECM");
string[] Texts = TxtPaste.Text.Split({, "\r\n", "\r", "\n");
StringSplitOptions.RemoveEmptyEntries;
LstParts.DataSource = Texts;
LstParts.Refresh();
LblContador.Text = LstParts.Items.Count;
try {
AppActivate(ReturnValue);
// Activate
foreach (string Text in Texts) {
Clipboard.Clear();
Clipboard.SetText(Text);
Thread.Sleep(3000);
SendKeys.Send("^v");
SendKeys.Send("{DOWN}");
this.LstParts.SelectedIndex = x;
x++;
}
MsgBox("Process Finished", MsgBoxStyle.Information, "Finish....!");
// TODO: Labeled Arguments not supported. Argument: 3 := 'Title'
}
catch (Exception ex) {
MsgBox(("ECM not open " + ("\r\n" + "ERROR ..!")), MsgBoxStyle.Critical, "WARNING");
}
}
推荐答案
您可以在WebBrowser控件中托管页面吗?这样您就可以直接访问基础HTML。
P.S.我不羡慕你。
Can you host the page in a "WebBrowser" control? That would give you direct access to the underlying HTML.
P.S. I don't envy you.
这篇关于将数据发送到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!