|
i have a web application running on a server. This application needs to fetch data from some other PC(Clients), which are on a different network.
In this case web application is showing real time data from client pc which is logged in.
what technologies i have to used??
|
|
|
|
|
What kind of "real time data" you want to fetch?
You have just been Sharapova'd.
|
|
|
|
|
Real time data like client pc CPU usage, available ram memory, used ram .
In short server and clients share data with each other.
|
|
|
|
|
What have you found in your research on server<=>client communication in Windows ?
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin
|
|
|
|
|
I found that signalr technology is good in term of server-client communication.
but issue i got in this is authentication ...
other technology which is socket programming. but it has some limitation and require ssl certificate if it run on public IP.
i want like client can login on web portal and send-receive data from windows application which is installed on windows with same credentials. means user can do action from web portal from anywhere if windows exe is installed and logged in.
|
|
|
|
|
gautamkhatri428 wrote: This application needs to fetch data from some other PC Actually it is the other way round, the client PC needs to send the data to the server. Socket connections or WCF would be the way to do it.
|
|
|
|
|
it is possible in WCF to send data from server to client and vice versa .. simultaneously ???
and socket programming requires ssl certificate and then need to install certificate on client pc.
|
|
|
|
|
gautamkhatri428 wrote: it is possible in WCF to send data from server to client and vice versa .. simultaneously ? I assume so, but you need to read the documentation.
gautamkhatri428 wrote: socket programming requires ssl certificate Not necessarily.
|
|
|
|
|
In order of your questions:
1. Yes
2. No, it isn't.
This space for rent
|
|
|
|
|
Also keep in mind that when he said "the client PC needs to send the data" that means that software to do just that must be running on the client machine.
The client, not the server.
Your question then is pointless unless you can install your software on the server. The client might provide some way to retrieve that information by itself. However for you to use that you must
1. Find that software
2. Insure it is running
3. Insure that it can be accessed from your server
4. Figure out the protocol of 1 and then use it
Not that 4, which is basically your original question, is pointless until 1 to 3 have been resolved.
|
|
|
|
|
Hi,
I 'am trying to call default.html from my universal C# project ,a file in which I have defined my Google map,this is the tutorial reference:
Google Maps API on Windows Store App 8.1
and this is my code: in MainPage.xaml.cs:
public MainPage()
{
this.InitializeComponent();
LoadData();
MapWebView.NavigateToString(GeneratedHTML);
}
private async void LoadData()
{
try
{
await loadJsonLocalnew("default.html", "");
}
catch (Exception ex)
{
throw;
}
}
public async static Task loadJsonLocalnew(string url, object ClassName)
{
try
{
var folder = await StorageFolder.GetFolderFromPathAsync(Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"\");
StorageFile file = await folder.GetFileAsync(url);
Stream stream = await file.OpenStreamForReadAsync();
StreamReader reader = new StreamReader(stream);
String html = reader.ReadToEnd();
GeneratedHTML = html.ToString();
}
catch (Exception ex)
{
}}
this is the xaml file:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<WebView x:Name="MapWebView" Width="Auto" Height="700"/>
</Grid>
but this time the html variable has this content:
Some files or contents of this website require a program that is not installed on your computer.
and I get a white page how can I deal with this problem
thanks for help
|
|
|
|
|
var folder = await StorageFolder.GetFolderFromPathAsync(Windows.ApplicationModel.Package.Current.InstalledLocation.Path + @"\");
StorageFile file = await folder.GetFileAsync(url);
You declare and initialize a variable named folder , but then you never use it.
Were you supposed to combine the folder path with the url to form the complete path to default.html ?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
is it possible to setpixel and getpixel on controls?
|
|
|
|
|
|
No, because GetPixel and SetPixel are part of the Bitmap class, and Controls are not derived from Bitmap.
What are you trying to achieve that you think you need this?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Not to mention that SetPixel and GetPixel are really slow...
You're going to have to explain what you're trying to do and how these functions play into this goal.
|
|
|
|
|
Assuming you can get a bitmap of the current visual state of a Control, which you can do in WinForms pretty easily, well ...
Yes, you could manipulate that bitmap with Get/Set/Pixel, and then re-draw it onto the surface of the Control.
But, I can't think of a single-case where that would be a wise thing to do.
What you can do, and has been done, frequently, is to sub-class a Control in WinForms, like a 'Button, and then make it owner-drawn, and handle all the drawing yourself.
But, as comments here have told you, you are going to take big hit on performance using Get/Set/Pixel.
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin
|
|
|
|
|
As other have mentioned, it's rather pointless to use SetPixel/GetPixel on controls (that is, getting a Handle, getting a DC, and converting that to a bitmap).
What are you trying to achieve? Pretty sure you will end up using something else.
Best,
John
-- LogWizard - a Log Viewer that is easy and fun to use!
|
|
|
|
|
Please Help
How can I replace all text in a listBox1 that matches "some text " with "other text "?
I tried, but does not work...thanks.
private void button1_Click_1(object sender, EventArgs e)
{
listBox1.Items = listBox1.Items.ToString.Replace("some text ", "other text ")
}
|
|
|
|
|
I would approach this by:
private List<string> listItemData = new List<string>
{
"one","two","three","two","five","six","seven","two","nine","ten"
};
private void Form1_Load(object sender, EventArgs e)
{
listBox1.DataSource = listItemData;
}
private void ReplaceInListBox(string toFind, string toReplace, bool replaceOneItemOnly)
{
int ndx;
string itm;
for (int i = 0; i < listItemData.Count; i++)
{
itm = listItemData[i];
if (itm == toFind)
{
ndx = listItemData.IndexOf(itm);
listItemData.RemoveAt(ndx);
listItemData.Insert(ndx, toReplace);
if (replaceOneItemOnly) break;
}
}
listBox1.DataSource = null;
listBox1.DataSource = listItemData;
listBox1.Invalidate();
}
private void SomeButton_Click(object sender, EventArgs e)
{
ReplaceInListBox("two", "twenty", false);
} By the way, it would be interesting to know why it is you want to dynamically change the ListBox Items; that's something I would avoid unless it was absolutely necessary.
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin
|
|
|
|
|
I am dynamically binding a tree-view.I have multiple root nodes and multiple child nodes.OnSelectedNodeChanged event is firing only for childnodes of first root node.If I click on child nodes of second root node,i am getting root node value only in Treeview.Selectednode.Text. Can anyone help?this is my code..
this is my code..
private void FillCategories(string item, TreeNode parent)
{
string[] category1 = item.Split(',');
TreeNode tnParent = new TreeNode();
tnParent.Text = category1[1];
tnParent.Value = category1[0];
tnParent.ToolTip = category1[1];
tnParent.SelectAction = TreeNodeSelectAction.SelectExpand;
tnParent.CollapseAll();
tnParent.Selected = true;
parent.ChildNodes.Add(tnParent);
FillMetadata(tnParent, tnParent.Value);
}
private void FillMetadata(TreeNode parent, string categoryId)
{
DataSet ds = PDataset("SELECT MetadataID,MetadataName FROM Metadata WHERE MetadataID IN (SELECT MetadataID FROM CategoryMetadata WHERE CategoryID =" + categoryId + ") and ParentMetadataID IS NULL");
parent.ChildNodes.Clear();
foreach (DataRow dr1 in ds.Tables[0].Rows)
{
TreeNode child = new TreeNode();
child.Text = dr1["MetadataName"].ToString().Trim();
child.Value = dr1["MetaDataID"].ToString().Trim();
child.ToolTip = child.Text;
child.SelectAction = TreeNodeSelectAction.Select;
child.CollapseAll();
parent.ChildNodes.Add(child);
FillSubMetadata(child, child.Value);
}
}
private void FillSubMetadata(TreeNode child, string metadataId)
{
DataSet ds = PDataset("SELECT MetadataID,MetadataName FROM Metadata WHERE ParentMetadataID =" + metadataId + " ");
child.ChildNodes.Clear();
foreach (DataRow dr1 in ds.Tables[0].Rows)
{
TreeNode subchild = new TreeNode();
subchild.Text = dr1["MetadataName"].ToString().Trim();
subchild.Value = dr1["MetaDataID"].ToString().Trim();
subchild.ToolTip = subchild.Text;
subchild.SelectAction = TreeNodeSelectAction.Select;
subchild.CollapseAll();
child.ChildNodes.Add(subchild);
}
}
|
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Does anyone know how to make a countdown timer?
I have tried but no methods I try work.
|
|
|
|
|