|
Guys don't be too hard with him. you have 2 ways to do it:
1. with special equipment like Intel real sense or Microsoft Kinect v2. The real sense comes with tons of .net samples and fully integrated to Unity. You can find Mirosoft Kinect V2 samples in the unity market but its only fully integrated with the Unity pro version. you can still use the free but its not that comfortable...
2. Just use a third party library like OpenCV (but there are others…)
http://docs.opencv.org/modules/contrib/doc/facerec/facerec_tutorial.html
|
|
|
|
|
Don't know why you are saying this to me. I am the one who recommended getting a RealSense Camera and the SDK.
|
|
|
|
|
Sorry, clicked the wrong "reply"
|
|
|
|
|
Hi,
I want to send mail asynchronously using .net libraries. I am using SendMailAsych() it is working fine for webForm application but same code is not working for console application. Below is code which i am using in my project. Please can you tell me where i am doing mistake. SendMail is funtion which I am using to send mail.
public async Task SendMail(string subject, string body, List<string>attachments)
{
AddSubject(subject);
AddBody(body);
for (int i = 0; i < attachments.Count; i++)
{
AddAttachment(attachments[i]);
}
await SendMailFinally();
}
public Task SendMailFinally()
{
return Task.Run(() =>
{
try
{
smtpserver.SendMailAsync(mail);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
);
}
Thanks
|
|
|
|
|
When you say it's not working, what exactly do you mean by it's not working? Are you seeing any exceptions?
|
|
|
|
|
Not working mean mail is not send to client. And i am not getting any exception also.
|
|
|
|
|
What does the code that calls this method look like? Are you waiting for the task to complete before your application exits?
|
|
|
|
|
In main code i am calling SendMail as follows
try
{
smtpmail.SendMail(subject, body, list);
}
catch(Exception ex)
{
Console.Writeline(ex.ToString());
}
Yeah i am not waiting for it where i am calling SendMail.
|
|
|
|
|
So basically, you're creating an asynchronous task and then exiting it before it completes.
|
|
|
|
|
Ahhh that might be the case , but i put a sleep of 5 minute still it didnt not worked.
|
|
|
|
|
Member 11881409 wrote: Yeah i am not waiting for it where i am calling SendMail.
Well that's the problem - the console application is exiting before the SmtpClient has had a chance to send the message.
static void Main()
{
try
{
Task sendEmailTask = smtpmail.SendMail(subject, body, list);
sendEmailTask.GetAwaiter().GetResult();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
Your SendMailFinally method is also dodgy - you're spinning up a new Task to call a method which spins up a new Task to do its work, and you're not await ing the result of the SendMailAsync method. Change it to:
public async Task SendMailFinally()
{
try
{
await smtpserver.SendMailAsync(mail);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
An issue occur while performing multiFile selection in framework 3.5. I am using 'jquery.MultiFile.js' and 'jquery-1.8.2.js' scripts to achieve it. My attachment control is inside a update panel within Tab control. Everything is fine but when i am use async or full post back then file uploader control can not read script and can not select multiple files. My Code part is as follows :
<script src="../Scripts/jquery.MultiFile.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.8.2.js" type="text/javascript"></script>
<div class="PageMainTable">
<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" AutoPostBack="true" ActiveTabIndex="1"
OnActiveTabChanged="TabContainer1_ActiveTabChanged">
<ajaxToolkit:TabPanel ID="tb_home" runat="server" HeaderText="Home">
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="CSR Registration Process">
<ContentTemplate>
<asp:UpdatePanel ID="up_addupdt" runat="server" UpdateMode="Conditional" >
<Triggers>
<asp:PostBackTrigger ControlID="btn_save" />
</Triggers>
<ContentTemplate>
.....
<tr>
<td class="lbl_text">Attachment:
</td>
<td colspan="4">
<asp:FileUpload ID="FileUpload1"
maxlength="5" runat="server" class="multi" />
</td>
<td align="left" colspan="4">
<asp:Label ID="lbl_attach" runat="server" Text="" Visible="false"></asp:Label>
</td>
</tr>
...
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="drop_system" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
On async post back of drop down (drop_system) file uploader behave normal and could not allow me to select multiple files.
Pls reply to my query as early as possible.
Thanx in advance.
|
|
|
|
|
That is ASP.NET code. Please use the correct forum.
|
|
|
|
|
How do I Filter a value selected from the dropdown list? note. the dropdown list is populated with values from another table.
|
|
|
|
|
The best method is to filter the table so you only populate the dropdown with the necessary information.
|
|
|
|
|
Why is it that Metro style apps do not include "Imports System.Data.SqlClient"?
I found this out about a year ago and I have not asked why Visual Studios for metro apps does not allow for SqlClient. I feel that by doing this Microsoft is pushing away developers from using MSSQL Server. So you have options of using SQL Lite, Azure Web Services, WCF and there might be other ways to get data. However that takes away from precious time us developers have to make apps.
Also are there any work arounds for using MSSQL Server and using Imports System.Data.sqlClient?
Sincerely a Developer.
|
|
|
|
|
I think you should direct your question to Microsoft.
|
|
|
|
|
Microsoft is already alert, but isn't implementing. This namespace of .NET isn't available, instead he needs to work with Storage APIs.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
hi,
i have google autocomplete suggestion in textbox and added jquery autocmplete suggestion to google pac-container div.
If i select the jquery suggestions from div, i am able to fire in
$(document).on("click", function (e) {
]
but i need to get selected element value. below is my div.
LondonUnited Kingdom London BridgeBengaluru, Karnataka, India LonavalaMaharashtra, India Longitude GroupLavelle Road, D Souza Layout, Bengaluru, Karnataka, India LondenpetKrishnagiri, Tamil Nadu, India 830 LONG DRIVE, ABERDEEN, MARYLAND, UNITED STATES, 21001 2370.628906-4569.779785 830 LONG DRIVE, ABERDEEN, MARYLAND, UNITED STATES, 21001 2371.930664-4571.367188 1 AVENUE DELAFOSSE PROLONGEE 01 BP 2185, ABIDJAN, COTE D'IVOIRE, 2185 320.179077-241.665054 9910 AVALON ROAD NW, ALBUQUERQUE, NEW MEXICO, UNITED STATES, 87121 2105.522949-6394.536133 9910 AVALON ROAD NORTHWEST, ALBUQUERQUE, NEW MEXICO, UNITED STATES, 87121 2103.865723-6389.127441
based on Div selection option (id =areasearch or class="pac-item-areasearch") i need to get the addrees and lat & lon.
How to achieve selected div element values .
if anybody knows reply me.
Thanks in advance.
modified 24-Jul-15 8:31am.
|
|
|
|
|
You might want to ask this question in the web development forum. It has nothing to do with the .NET Framework, and you will find that it's better to get help from the experts in the appropriate forum.
|
|
|
|
|
With this type of code which is the best option to check a column prior to inserting data? Stored procedure or additional code here.
thanks
con.Open();
SqlCommand cmd = new SqlCommand("insert into MOD_002 values('" + DropDownList4.SelectedValue + "','" + DropDownList5.SelectedValue + "','" + TextBox9.Text + "','" + Datebox.Text + "','" + Operator0.Text + "','" + TextBox8.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
Label4.Text = "MOD_002 is updated"; con.Open();
SqlCommand cmd = new SqlCommand("insert into MOD_002 values('" + DropDownList4.SelectedValue + "','" + DropDownList5.SelectedValue + "','" + TextBox9.Text + "','" + Datebox.Text + "','" + Operator0.Text + "','" + TextBox8.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
Label4.Text = "MOD_002 is updated";
|
|
|
|
|
Best to use command parameters instead of a constructed string, but if you must then you must verify all parameters yourself in your code.
|
|
|
|
|
I would say that you should separate the program into layers:
1. The User Layer handles user interactions.
2. The Business Layer validates the data and does any necessary processing.
3. The Data Layer stores the data in the database.
In this model, all validation should be done in the Business Layer.
Your code fragment mixes the layers; you have the Data Layer, you want to add validation (part of the Business Layer), and you also have the User Layer (in the last line).
IMO, the only validation that should be performed inside the database is inherent:
1. Unique indexes must be unique.
2. non-Null fields must be non-Null.
etc.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
I have a problem in trying to make an Inventory Report using crystal report in my Sales and Inventory System using vb.net.
I have two tables (Purchase and Sales). Whenever I used this line of code, It will give the correct total item purchased with Item name in a given date:
str = "SELECT Purchase.Item, SUM(Purchase.Quantity_received) as Purchases FROM Purchase WHERE " _
& " Purchase.PO_Date between #" & dtfrom.Value.ToShortDateString & "# AND #" & dtto.Value.ToShortDateString _
& "# GROUP BY Purchase.Item"
When using the line of code below, the total item purchased in a given date will be no longer the same and correct. I'am confused with how will I correctly join and group multiple tables.
str = "SELECT Purchase.Item, SUM(Purchase.Quantity_received) as Purchases, SUM(Sales.Quantity) as Sold FROM Purchase INNER JOIN Sales ON Purchase.Item=Sales.Item_Description WHERE " _
& " Purchase.PO_Date between #" & dtfrom.Value.ToShortDateString & "# AND #" & dtto.Value.ToShortDateString _
& "# AND Sales.Sales_Date between #" & dtfrom.Value.ToShortDateString & "# AND #" & dtto.Value.ToShortDateString _
& "# GROUP BY Purchase.Item"
I want the following result in my crystal report:
1. To have a complete Item Name list of my Purchases with the corresponding Quantity of the total purchase ordered in the given date
2. To get the total Quantity of Items Sold in the given date
3. To get the remaining stocks in the given date
Any help would be much appreciated. Thank you.
|
|
|
|