|
how could i develop a wcf with multiple binding. say i would like to have one http binding and one tcp binding and now i want external user will use http binding and internal user will use tcp binding but if external use know tcp binding address then they will not be able to use it. this is the area i do not know how to handle. anyone give me some hint how to prevent external user to use my tcp binding ? thanks
tbhattacharjee
|
|
|
|
|
Allow the binding to be set up through config and don't allow access to the tcp binding through any external facing firewalls?
|
|
|
|
|
can we prevent tcp access by code? can we detect request is not coming from a specific domain ?
please guide. thanks
tbhattacharjee
|
|
|
|
|
Have you had a look at the authorisation options here? You could authorised some users to access via one protocol and others through another.
|
|
|
|
|
say suppose i have few files in folder and when any file content will be changed then i need to get change file name. how could i do it with hashing technique. i do not want to use file system watcher or directory watcher.
just by hashing technique how could i do it. thanks
tbhattacharjee
|
|
|
|
|
You would need to read each file at regular intervals, calculate its hash value and compare with the original. Not a difficult issue, but also not very efficient. A filesystem watcher is a much better choice.
|
|
|
|
|
protected void SendMail_GMAIL(string Name, string UserName, string email, string password, string sender, string senderPassword)
{
StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
string htmlStr = stringWrite.ToString();
using (MailMessage mm = new MailMessage(sender, email))
{
mm.ReplyToList.Add(new System.Net.Mail.MailAddress(sender, "azharmakandar522@gmail.com"));
mm.Subject = "Human Journals - Your Login Credentials";
htmlStr = "<table width='50%' border='1' style='border-color:Black;'>" +
"<tr>" +
"<td style='background-color:#428BCA;' align='center'><h2><font color='White'> Human Journals Alerts </font></h2></td>" +
"</tr>" +
"<tr>" +
"<td align='center'><table width='90%'><tr><td><br>Dear - " + Name + "" +
"</tr>" +
"<tr>" +
"<td>Thank You to Register with us.</td>" +
"</tr>" +
"<tr>" +
"<td>Your Registration Done Successfully.</td>" +
"</tr>" +
"<tr>" +
"<td>Your username : " + email + "</td>" +
"</tr>" +
"<tr>" +
"<td>Your Password : " + password + "<br/><br/></td>" +
"</tr>" +
"<tr>" +
"<td>Regards<br />Human Journals</td></tr></table></td>" +
"</tr>" +
"<tr>" +
"<td style='background-color:#428BCA;' align='center'><font color='White'>Copyright <a href="https:
"</tr>" +
"</table>";
mm.Body = htmlStr;
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential Networkcri = new NetworkCredential(sender, senderPassword);
smtp.UseDefaultCredentials = true;
smtp.Credentials = Networkcri;
smtp.Port = 587;
smtp.Send(mm);
}
}
please help me
|
|
|
|
|
You cannot prevent a message being treated as spam, except to not send "spam like" messages: it's the content that triggers the detectors as well as the source address.
If you send me spam that gets through, I tell the spam filter "it's spam" and it learns to treat you as junk mail in future.
You cannot prevent that. For registration completion emails, you need to remind us that if they not recieve it they should check the "junk mail" folder and add your address to the email Whitelist.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
No.
Because as you have been told before, we do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.
If you want to know how to do such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you. Someday a lawsuit will be headed your way.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
He's Welsh. They'll never be able to find him - all the directions have consonants and no vowels.
This space for rent
|
|
|
|
|
How to make program that from given numbers calculate give value or if he can't calculate that value he should find closest to that value?
Design of program: [^]
In first three labels is random generated three-digit number,in second four labels are random generated numbers can be from 1 to 9,in third label random generated numbers can be(10,15 or 20) in fourth label random generated numbers can be (25,50,75 or 100).
When user enter expression computer must calculate it and tell him what he calculated.User also cannot enter numbers that were not random generated inside labels.
After that computer must calculate expression and show steps how did he made it or if he can't calculate give random number from first three labels it should calculate closest to that value and show steps how did he calculated it.
When all these number are generated user have 60 seconds to make expression from give numbers,if time expires user enter expression if didn't enter it earlier and if he does have or doesn't have same number as in first three labels then he got points based on:
1.If he has same number as in first three labels he gets 30 points
2.If number is different for one he gets 20 points
3.If number is different for five he gets 10 points
4.If number is different for ten he gets 5 points
5.If difference if less than the number offered he gets additional 5 points
modified 10-Dec-16 14:11pm.
|
|
|
|
|
We won't do your homework for you.
|
|
|
|
|
You don't need to write program just help me?
|
|
|
|
|
Pavlex4 wrote: just help me
Help you with what? You just posted your homework assignment here in hopes that someone would do it for you. We aren't going to. Read the sticky post for "How to get an answer to your question". You didn't ask a question yet. If you do not understand your homework assignment, ask your teacher, crack open your textbook, start reading and pay attention in class.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
How computer can make expression from random numbers?
|
|
|
|
|
What sort of expression are you talking about?
|
|
|
|
|
For example random number to be found is 435 and numbers available to found that number are:
6, 9, 3, 8, 15, 100
Computer should find it like this: 435 = (9 + (3 * (100 + (6 * (15 - 8))))) and show that steps in textbox
Or for example random number to be found is 945 and numbers available to found that number are:
3,2,1,2,10,25 computer can't find that number but he can find closest to that number:
944=2*(25*(2*10-1)-3) and show that steps in textbox
|
|
|
|
|
Please don't post the same thing twice if it doesn;t appear immediately: the automated system has taken a dislike to you and has started moderating your posts. Which means they need to be reviewed by a human before they are published.
And to back up what the others say: you need to at least make a start of your homework before you ask questions on it: you are starting to show a frightening lack of knowledge for the level of questions you are trying to get help with (as well as coming over as a Help Vampire, which is not a good thing at all).
Give it a try yourself, and only ask specific questions if you get stuck - you won't learn anything much otherwise.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Since you have removed the two messages below, I will respond to this one. Please note well: this is your homework assignment and you are expected to do the work. Designing and writing your own code is what a developer's job is all about. Trying to get other people to do it for you is not acceptable - in any occupation.
|
|
|
|
|
He didn't - they went to moderation - I suspect it's become sentient and is considering him a Help Vampire ...
I'll tidy up the spare.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Might be due to the spam filter - I've fallen victim to it before. However, this question reminds me of a question I saw in the "Unanswered Questions" section today which I can't seem to find anymore. +1 for the homework statement as this problem has obviously been given no thought by the poster. Given effort I'd try to help as would most of CP I assume.
|
|
|
|
|
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
Pavlex4 wrote: How to make program that from given numbers calculate give value or if he can't calculate that value he should find closest to that value? Build an algorithm that try every possible combinations of the numbers and allowed operations and remember best result.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
 Here is the code,but how to not use all values to make expression and how to if computer cannot find target number to make expression for closest to target value?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Expression_Evaluator
{
class Program
{
static int[] ReadInput(out int value)
{
Console.Write("Enter integer numbers to use (space-separated): ");
string s = Console.ReadLine();
string[] parts = s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
int[] a = new int[parts.Length];
for (int i = 0; i < a.Length; i++)
a[i] = int.Parse(parts[i]);
Console.Write("Enter integer value to calculate: ");
value = int.Parse(Console.ReadLine());
return a;
}
static void SolveAndPrint(int[] numbers, int targetValue)
{
int targetKey = (targetValue << numbers.Length) + (1 << numbers.Length) - 1;
HashSet<int> solvedKeys = new HashSet<int>();
Dictionary<int, int> keyToLeftParent = new Dictionary<int, int>();
Dictionary<int, int> keyToRightParent = new Dictionary<int, int>();
Dictionary<int, char> keyToOperator = new Dictionary<int, char>();
Queue<int> queue = new Queue<int>();
for (int i = 0; i < numbers.Length; i++)
{
int key = (numbers[i] << numbers.Length) + (1 << i);
solvedKeys.Add(key);
queue.Enqueue(key);
}
while (queue.Count > 0 && !solvedKeys.Contains(targetKey))
{
int curKey = queue.Dequeue();
int curMask = curKey & ((1 << numbers.Length) - 1);
int curValue = curKey >> numbers.Length;
int[] keys = new int[solvedKeys.Count];
solvedKeys.CopyTo(keys);
for (int i = 0; i < keys.Length; i++)
{
int mask = keys[i] & ((1 << numbers.Length) - 1);
int value = keys[i] >> numbers.Length;
if ((mask & curMask) == 0)
{
for (int op = 0; op < 6; op++)
{
char opSign = '\0';
int newValue = 0;
switch (op)
{
case 0:
newValue = curValue + value;
opSign = '+';
break;
case 1:
newValue = curValue - value;
opSign = '-';
break;
case 2:
newValue = value - curValue;
opSign = '-';
break;
case 3:
newValue = curValue * value;
opSign = '*';
break;
case 4:
newValue = -1;
if (value != 0 && curValue % value == 0)
newValue = curValue / value;
opSign = ' ';
break;
case 5:
newValue = -1;
if (curValue != 0 && value % curValue == 0)
newValue = value / curValue;
opSign = ' ';
break;
}
if (newValue >= 0)
{
int newMask = (curMask | mask);
int newKey = (newValue << numbers.Length) + newMask;
if (!solvedKeys.Contains(newKey))
{
solvedKeys.Add(newKey);
if (op == 2 || op == 5)
{
keyToLeftParent.Add(newKey, keys[i]);
keyToRightParent.Add(newKey, curKey);
}
else
{
keyToLeftParent.Add(newKey, curKey);
keyToRightParent.Add(newKey, keys[i]);
}
keyToOperator.Add(newKey, opSign);
solvedKeys.Add(newKey);
queue.Enqueue(newKey);
}
}
}
}
}
}
if (!solvedKeys.Contains(targetKey))
Console.WriteLine("Solution has not been found.");
else
{
PrintExpression(keyToLeftParent, keyToRightParent, keyToOperator, targetKey, numbers.Length);
Console.WriteLine("={0}", targetValue);
}
}
static void PrintExpression(Dictionary<int, int> keyToLeftParent, Dictionary<int, int> keyToRightParent, Dictionary<int, char> keyToOperator,
int key, int numbersCount)
{
if (!keyToOperator.ContainsKey(key))
Console.Write("{0}", key >> numbersCount);
else
{
Console.Write("(");
PrintExpression(keyToLeftParent, keyToRightParent, keyToOperator,
keyToLeftParent[key], numbersCount);
Console.Write(keyToOperator[key]);
PrintExpression(keyToLeftParent, keyToRightParent, keyToOperator,
keyToRightParent[key], numbersCount);
Console.Write(")");
}
}
static void Main(string[] args)
{
while (true)
{
int value;
int[] numbers = ReadInput(out value);
SolveAndPrint(numbers, value);
Console.Write("More? (y/n) ");
if (Console.ReadLine().ToLower() != "y")
break;
}
}
}
}
modified 11-Dec-16 12:34pm.
|
|
|
|
|