|
Hmmm, LINQ never messed with it, I have a look....
|
|
|
|
|
|
Thanks for that when I have the time I will take a look at using LINQ, PIEBALDconsult's method works for what I am trying to do, can you recommend any sources for LINQ ?
|
|
|
|
|
|
I had found the MSDN stuff, so it looks like I have been LINQ'ing for a time with out realizing it....
|
|
|
|
|
|
|
There are obviously fairly serious synchronisation issues here, if there is any chance you could have two threads or two applications running at the same time. You probably realise that but just making sure!
|
|
|
|
|
As far as I am aware at the moment I have only one thread on the go! Thanks for the heads up though!
|
|
|
|
|
is it possible to make ping to another computer in windows-mobile
using C# code ?
thanks
|
|
|
|
|
Please don't crosspost. Pick one forum and stick with it.
|
|
|
|
|
I m new in this C# language so i find problem in talking sound input from mic.
I don't know how to use API and want to solve this problem without using API
|
|
|
|
|
|
Is there any other way which can someone send post or get values with C# to PHP and previewing them with PHP in internet explorer??
An 100% solution is to use ProcessStartInfo( "my link&value = ","my data");
And when i'll do a echo $_GET['value'] it returns my data just fine. But the problem is that i have to do with million or billion values.
If i put on and EventHandler which reads from serialport,
Then IE or other browser will opens me million or billion tabs!!! What should i do for this way or propose me something else please???
Thanks
All the truth becomes from knowledge...
|
|
|
|
|
Why don't you collate all this data together and show all of this in a single tab by just sending one echo value.
|
|
|
|
|
I'm reading my data from a device. So i want these values to preview in a website realtime too in a PHP website.
How to do something like that?
Thanks
All the truth becomes from knowledge...
|
|
|
|
|
Why do you want to use a browser for this? What you want to do most of the time is update a value – a web page is not the ideal medium for that. Just use a form with some labels or a table or however you want to visualise the data, and update it whenever you get a new value.
|
|
|
|
|
They want to do something like that. They want to display my data both C# and IE php website realtime too.
All the truth becomes from knowledge...
|
|
|
|
|
Push the data into a database or something else that the website can look at, and have the website auto-refresh its data sections via an AJAX callback.
|
|
|
|
|
Hello everybody!I want to ask you something. I want to send values from C# windows form application in php webpage.In other words send post values from C# to php.
The problem is that php script cannot read this values and preview this results which comes from C# app.Could you help me please?
Here is the C# code:
using System;
using System.Net;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Text;
using System.IO;
namespace WebRequestExample
{
class WebPostRequest
{
public string Post(IDictionary<string, string> objects)
{
WebRequest request = WebRequest.Create("http://127.0.0.1/sensor.php");
request.Method = "POST";
StringBuilder b = new StringBuilder();
foreach (KeyValuePair<string, string> o in objects)
b.Append("?").Append(HttpUtility.UrlEncode(o.Key)).Append("=").Append(HttpUtility.UrlEncode(o.Value ?? ""));
string postData = b.ToString(1, b.Length-1);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
if (((HttpWebResponse)response).StatusCode != HttpStatusCode.OK)
return null;
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
return responseFromServer;
}
class MainClass
{
public static void Main(string[] args)
{
WebPostRequest a = new WebPostRequest();
IDictionary<string, string> postData = new Dictionary<string, string>();
postData.Add("data", "123156564648989");
Console.WriteLine(a.Post(postData));
Console.ReadLine();
}
}
}
}
And a very simple php script to display the post data!
<?
<pre> print_r($_POST);
echo $_POST['data'];
echo '<br>';
echo $_REQUEST['data'];
echo '<br>';
var_dump( $_REQUEST);
echo '<br>';
echo '<file_get_contents>';
$postdata = trim(file_get_contents('php://input'));
$postdata = urldecode($postdata);
var_dump( $postdata);
echo '<br>';
?>
?>
Could you help me please? I repeat that the problems is that PHP cannot preview the POST data which becomes from C# windows form application. It always returns NULL.
Thanks alot!
All the truth becomes from knowledge...
|
|
|
|
|
I have 20 textBox type objects with parameter Enabled=False, they are named "prog1", "prog2" e.t.c.
And button - Button1; I need on button click set paremeter Enabled=True one by one on each button click. Thanks in advance and sorry for my bad english =)
|
|
|
|
|
Do you mean one button to enable all of them at once?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
no. One by one on every button click.
1. click on a button - prog1.Enabled = True;
2. click on a button - prog2.Enabled = True;
3. click... e.t.c.
Enable all 20 textboxes one by one on every button click.
|
|
|
|
|
Perhaps add them to a list and maintain a counter so you can enable the next one?
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsTestApp
{
public partial class Form1 : Form
{
private List<TextBox> textBoxes;
private int textBoxCounter = 0;
public Form1()
{
InitializeComponent();
textBoxes = new List<TextBox>(new TextBox[]{
textBox1,
textBox2,
textBox3
});
}
private void button1_Click(object sender, EventArgs e)
{
textBoxes[textBoxCounter].Enabled = true;
textBoxCounter++;
if (textBoxCounter == textBoxes.Count)
button1.Enabled = false;
}
}
}
Edit:
If you only need to do this once, a Queue<T> would be better and you won't need the counter:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsTestApp
{
public partial class Form1 : Form
{
private Queue<TextBox> textBoxes;
public Form1()
{
InitializeComponent();
textBoxes = new Queue<TextBox>(new TextBox[]{
textBox1,
textBox2,
textBox3
});
}
private void button1_Click(object sender, EventArgs e)
{
textBoxes.Dequeue().Enabled = true;
button1.Enabled = textBoxes.Count > 0;
}
}
}
modified 10-Jun-12 16:21pm.
|
|
|
|
|
Tried both examples, they don't work with my program, maybe i'm doing something wrong. When i click button nothing happens.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace datori_konf
{
public partial class datoru_konf : Form
{
private Queue<TextBox> textBoxes;
public datoru_konf()
{
InitializeComponent();
textBoxes = new Queue<TextBox>(new TextBox[]{
prog1,
prog2,
prog3,
prog4,
prog5,
prog6,
prog7,
prog8,
prog9,
prog10,
prog11,
prog12,
prog13,
prog14,
prog15,
prog16,
prog17,
prog18,
prog19,
prog20
});
}
private void button4_Click(object sender, EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
Form2 form = new Form2();
form.ShowDialog();
}
private void button1_Click(object sender, EventArgs e)
{
textBoxes.Dequeue().Enabled = true;
button1.Enabled = textBoxes.Count > 0;
}
}
}
|
|
|
|