|
Hello,
I develop an Skype Tool, who will be very usefull for many people.
But now, I check the option to send an message for all the
Conversation in the skype account, but I haven't found any result!
So, I went over to this Forum to get some help, and to ask
if is it possible to send an message for all your conversation?
Thanks for all!
|
|
|
|
|
I'm sorry but I have had serious problems trying to decode the question you are asking here. Are you wanting to provide a mechanism to send a message to all the people a user is connected to via Skype?
This space for rent
|
|
|
|
|
No, I want to send an message for all my conversations.
|
|
|
|
|
Sorry, that's still no clearer. Try to explain, in a lot more detail, what it is that you are trying to achieve. What do you want to happen when the application is running. Remember that we don't have access to any requirements you may have, so it's up to you to make things clear to us what you want.
This space for rent
|
|
|
|
|
i want to create folders with c# on console by clicking on application
|
|
|
|
|
Sorry? That doesn't make a whole lot of sense.
Remember that we can't see your screen, access your HDD, or read your mind.
Creating a folder is simple in c#, whether it's a Console, Winforms, or WPF app:
Directory.Create(path); will do it: Directory.CreateDirectory Method (String) (System.IO)[^]
But the rest of your question I have not idea about - I can't tell what you are trying to do, or what problem you are meeting that prevents you doing it.
Please, try to explain in more detail and we'll try to help.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Thank you for your replay,
Actually i want to create a folder ,when i click on it's .exe file and it should be on visual studio console application
|
|
|
|
|
Sorry, but that doesn't make sense yet: a folder doesn't have "an exe file".
Go back a couple of stages, and try explaining in a lot more detail: don't try to be brief, because at the moment you are making assumptions about the project based on what you know, and we don't.
So what you tell us leaves huge gaps that you understand because you know what your task is, and we can't understand because we don't!
If it helps, try pretending that you are trying to explain what you are trying to do and what problem you are having to your mother over the phone: she knows nothing about your job or how to do it, so you need to explain it in terms she will understand. We are in the same position!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
So what problem do you have in achieving that?
|
|
|
|
|
System.IO.Directory.CreateDirectory(@"c:/vinay/");
i wrote this, it will creating folder . But what i want is when i click on .exe file then it will open a folder.
how can i achieve it.
|
|
|
|
|
Manoj Kumar Miriyala wrote: what i want is when i click on .exe file then it will open a folder Sorry, but that just makes no sense. When you click on a .exe file it runs the application. If the application needs to open a file then the System.IO namespace[^] contains the classes to help.
|
|
|
|
|
When you double-click on an .exe file, Windows runs the application.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
On my PC it uses a single-click: Explorer settings.
|
|
|
|
|
I should know better than to question anything you say ! If that option is enabled, I'd say you were "living dangerously"
I think it's reasonable to assume here the OP is using double-click to launch apps; however, what if someone else using their code is not: that's an issue the OP would have to deal with if they pursue this (imho) strange goal.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
BillWoodruff wrote: I should know better than to question anything you say ! On the contrary, you should never assume I know anything, let alone everything.
And I agree with your second statement. Trouble is I've been using single click for so long (since early XP days) I forget it's not the default.
|
|
|
|
|
First, I have never seen any application that exhibits this type of behavior; I think you must have a very strong reason for doing something so unusual.
There are three strategies you could pursue:
1. create a Windows Explorer-scope context-click menu extension that showed an option to create a folder for every Application context-clicked on. I would find such a menu extension very annoying.
To research this, start here: [^],
2. create a Windows Global Application Hook that would detect selection of a .exe file, and raise an Event you could process. I have never seen anyone try to create an Application Hook from a Console app, but, that doesn't mean it could not be done.
I suggest reading/studying this MSDN article first: [^].
There are several articles here on CodeProject on Windows Global App Hooks; I suggest you start with this one by George Mamaldze: [^]; then, search for and read other articles here on the same topic.
3. try to enumerate every Explorer window open and get the selected files/folders: [^].
In all these cases I think you are going to have a headache trying to implement them in a Console app, and I think the result will be not too useful.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
modified 19-Jun-16 7:29am.
|
|
|
|
|
|
I'm not sure of what your trying to achieve - to me, it sounds like
a) load data into 'R.Net'
b) process data in 'R.Net'
c) draw a chart in 'R.Net'
d) export the chart as an image to Excel
if 'd' is correct, then I think you're wasting your time .. can you not do
d) export the chart data to a '.csv' file that excel can read and produce a chart from
? - it seems 'simpler' and less complex - its just iterating the data frame, writing it as comma separated values to a file on disk
|
|
|
|
|
that is exactly what I wish to do. I know it may be simpler to do it directly in excel, but I would like to learn how to do it in C# using RDotNet.
If you could please tell me how, I would really appreciate it.
Thanks in advance.
|
|
|
|
|
well, I guess the crux is 'what you get back from the function'. That line
var x = engine.Evaluate("x <- rnorm(100, mean=50, sd=10)").AsNumeric();
returns 100 data points in x, yes ? what I dont know, is if x is a 2-d array or a dataframe - once you can determine that - I'd single step in debug mode until that step has been executed, then use the mouse and hover over 'x' and see what the debugger says its type is .... (I dont have 'R' installed) it surely is a simply matter to
a) open a file for writing - use a 'using' block
b) iterate 'x' by rows
c) for each column in the row, build a comma separated string
d) write the comma separated string to the file
e) {end-for}
really b & c are the bits that will differ depending on what it is (array, dataframe)
|
|
|
|
|
Thanks for the reply. I just have one more question.
How would I use an int array in RDotNet?
Currently I have this:
public void variance(REngine e, string[] x,int[] y)
{
var var1 = e.GetSymbol("var").AsFunction();
var1.Invoke(x).AsNumeric();
}
How would I use an int array in this function I am trying to call?
I am trying to use this as a method.
I think what I have to do is convert the array into a dataFrame, but I just don't know how.
modified 24-Jun-16 12:31pm.
|
|
|
|
|
I wrote this new version of a function to replace an older version, which reads a HTML file, replaces some values, and sends it back out for emailing.
I wrote an earlier post in which I said the HTML didn't persist, but that was an easy fix. I currently just don't understand why the replace is not working. It worked before when html_Template was a string builder.
I really don't want to use regex to replace the values, I'm not good at writing regex.
And I'm sure not if what I wrote is kosher and efficient. Maybe I can move the replace outside the using filestream.
private static string read_HTML_Template(
model_crm_contact_request cm)
{
string html_Template = string.Empty;
using (var htmlStream = new FileStream(cm.smtp_templatePath_customer, FileMode.Open, FileAccess.Read))
{
long htmlLen = htmlStream.Length;
byte[] bytes = new byte[htmlLen];
htmlStream.Read(bytes, 0, (int)htmlLen);
if (!(htmlStream == null))
htmlStream.Close();
var enc = new UTF8Encoding(true);
var preamble = enc.GetPreamble();
if (preamble.Where((p, i) => p != bytes[i]).Any())
html_Template = enc.GetString(bytes.ToArray());
else
html_Template = enc.GetString(bytes.Skip(preamble.Length).ToArray());
html_Template.Replace("<% smtp.WebsiteUrl %>", cm.smtp_websiteUrl);
html_Template.Replace("<% smtp.HeaderImage %>", cm.smtp_headerImage);
html_Template.Replace("<% smtp.CustomerName %>", cm.Name);
html_Template.Replace("<% smtp.WebsiteName %>", cm.smtp_websiteName);
html_Template.Replace("<% smtp.CustomerComment %>", cm.Query);
html_Template.Replace("<% smtp.TimeStamp_GMT %>", DateTime.UtcNow + " GMT");
html_Template.Replace("<% smtp.TimeStamp_UTC %>", DateTime.UtcNow + " UTC");
}
return html_Template;
}
|
|
|
|
|
I don't enough sleep on Thursday nights. Say I have a question, do you think this new version is the equiv to the old version below? Functionally the same except for the linefeed detector?
private static string read_HTML_Template(
model_crm_contact_request cm)
{
string html_Template = string.Empty;
using (var htmlStream = new FileStream(cm.smtp_templatePath_customer, FileMode.Open, FileAccess.Read))
{
long htmlLen = htmlStream.Length;
byte[] bytes = new byte[htmlLen];
htmlStream.Read(bytes, 0, (int)htmlLen);
if (!(htmlStream == null))
htmlStream.Close();
var enc = new UTF8Encoding(true);
var preamble = enc.GetPreamble();
if (preamble.Where((p, i) => p != bytes[i]).Any())
html_Template = enc.GetString(bytes.ToArray());
else
html_Template = enc.GetString(bytes.Skip(preamble.Length).ToArray());
}
html_Template = html_Template.Replace("<% smtp.WebsiteUrl %>", cm.smtp_websiteUrl);
html_Template = html_Template.Replace("<% smtp.HeaderImage %>", cm.smtp_headerImage);
html_Template = html_Template.Replace("<% smtp.CustomerName %>", cm.Name);
html_Template = html_Template.Replace("<% smtp.WebsiteName %>", cm.smtp_websiteName);
html_Template = html_Template.Replace("<% smtp.CustomerComment %>", cm.Query);
html_Template = html_Template.Replace("<% smtp.TimeStamp_GMT %>", DateTime.UtcNow + " GMT");
html_Template = html_Template.Replace("<% smtp.TimeStamp_UTC %>", DateTime.UtcNow + " UTC");
return html_Template;
}
This is the old version
private static string read_HTML_Template(
model_crm_contact_request cm)
{
FileStream htmlStream = null;
htmlStream = new FileStream(cm.smtp_templatePath_website, FileMode.Open, FileAccess.Read);
long htmlLen = htmlStream.Length;
byte[] fileData = new byte[htmlLen];
htmlStream.Read(fileData, 0, (int)htmlLen);
if (!(htmlStream == null))
htmlStream.Close();
byte[] byteLine = new byte[0];
string[] strArray = new string[0];
for (int bdx = 0; (bdx
<= (fileData.Length - 1)); bdx++)
{
byte byteVal = fileData[bdx];
if (!(byteVal == 13))
{
Array.Resize(ref byteLine, byteLine.Length + 1);
byteLine[byteLine.Length - 1] = byteVal;
}
else
{
Array.Resize(ref byteLine, byteLine.Length + 1);
byteLine[byteLine.Length - 1] = byteVal;
char[] charLine = new char[0];
Array.Resize(ref charLine, byteLine.Length + 1);
for (int cdx = 0; (cdx <= (byteLine.Length - 1)); cdx++)
{
charLine[cdx] = AsciiByteToChar(byteLine[cdx]);
}
string value = new string(charLine);
Array.Resize(ref strArray, strArray.Length + 1);
strArray[strArray.Length - 1] = value;
Array.Resize(ref byteLine, 0);
bdx++;
}
}
StringBuilder html_Template = new StringBuilder();
for (int idx = 0; (idx <= (strArray.Length - 1)); idx++)
{
int integerRead = 0;
char characterRead;
StringBuilder htmlBuilder = new StringBuilder();
StringReader charReader = new StringReader(strArray[idx]);
while (true)
{
integerRead = charReader.Read();
if ((integerRead == -1))
{
break;
}
characterRead = Convert.ToChar(integerRead);
if ((characterRead == '\t'))
{
}
else if (((characterRead == '\r') || (characterRead == '\n')))
{
}
else
{
htmlBuilder.Append(characterRead);
}
}
string htmlString = htmlBuilder.ToString();
htmlString = htmlString.Substring(0, (htmlString.Length - 1));
html_Template.Append(htmlString);
}
html_Template.Replace("<% smtp.WebsiteUrl %>", cm.smtp_websiteUrl);
html_Template.Replace("<% smtp.HeaderImage %>", cm.smtp_headerImage);
html_Template.Replace("<% smtp.CustomerName %>", cm.Name);
html_Template.Replace("<% smtp.WebsiteName %>", cm.smtp_websiteName);
html_Template.Replace("<% smtp.CustomerComment %>", cm.Query);
html_Template.Replace("<% smtp.TimeStamp_GMT %>", DateTime.UtcNow + " GMT");
html_Template.Replace("<% smtp.TimeStamp_UTC %>", DateTime.UtcNow + " UTC");
return html_Template.ToString();
}
|
|
|
|
|
I followed the tutorial here:
Importing and displaying a Data frame with C# and R.NET | Psychwire[^]
and I got errors on the code, here:
REngine.SetDllDirectory(dlldir);
REngine.CreateInstance("RDotNet");
REngine engine = REngine.GetInstanceFromID("RDotNet");
engine.EagerEvaluate("dataset<-read.table(file.choose(), header=TRUE, sep = ',')");
DataFrame dataset = engine.EagerEvaluate("dataset").AsDataFrame();
saying that it couldn't find the methods inRDotNet.Engine.
This is the code I am using:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Win32;
using RDotNet;
using RDotNet.NativeLibrary;
using Microsoft.Win32;
namespace RScript
{
public partial class Form1 : Form
{
public Form1()
{
string dlldir = @"C:\Program Files\R\R-3.3.0\bin\x64";
bool r_located = false;
Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + dlldir);
InitializeComponent();
while (r_located == false)
{
try
{
REngine.SetDllDirectory(dlldir);
REngine.CreateInstance("RDotNet");
r_located = true;
}
catch
{
MessageBox.Show(@"Unable to find R installation's \bin\i386 folder.
Press OK to attempt to locate it.");
/if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
dlldir = @folderBrowserDialog1.SelectedPath;
}/
}
}
}
private void button1_Click(object sender, EventArgs e)
{
REngine engine = REngine.GetInstanceFromID("RDotNet");
try
{
engine.EagerEvaluate("dataset<-read.table(file.choose(), header=TRUE, sep = ',')");
DataFrame dataset = engine.EagerEvaluate("dataset").AsDataFrame();
for (int i = 0; i < dataset.ColumnCount; ++i)
{
dataGridView1.ColumnCount++;
dataGridView1.Columns[i].Name = dataset.ColumnNames[i];
}
for (int i = 0; i < dataset.RowCount; ++i)
{
dataGridView1.RowCount++;
dataGridView1.Rows[i].HeaderCell.Value = dataset.RowNames[i];
for (int k = 0; k < dataset.ColumnCount; ++k)
{
dataGridView1[k, i].Value = dataset[i,k];
}
}
}
catch
{
MessageBox.Show(@"Equation error.");
}
}
}
}
can someone please help me out, since I really need your help?
I am new to R.Net.
I am using the newest version of RDotNet (1.6.5).
Thanks in advance!
|
|
|
|
|
If you are following a tutorial on another site, then I'd start by asking the person who wrote the tutorial, not a different site that has nothing to do with it.
If you look at the bottom of the page you link to, there is a "Thoughts on..." area, which is there for people - like you - to comment and ask questions.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|