Click here to Skip to main content
15,299,742 members

Comments by himanshu agarwal (Top 31 by date)

himanshu agarwal 3-Aug-15 5:01am View
   
Happy, it worked for you!
himanshu agarwal 3-Aug-15 5:00am View
   
If using textbox is making your application freeze, then I would like to know what other event handlers have you hooked on to on that text box?

Adding, another event handler will only degrade the performance.
himanshu agarwal 3-Aug-15 4:31am View
   
Yes, first try accessing, with IP/FQDN on local machine. Launching from IIS usually uses localhost not IP/FQDN.

Then ensure firewall settings are appropriate as Suvendu suggests.
himanshu agarwal 3-Aug-15 4:17am View
   
What do you mean by running a browser with VB?
himanshu agarwal 1-Aug-15 5:25am View
   
you may have to read the documentation or tweak it as per your need.
himanshu agarwal 31-Jul-15 7:36am View
   
Just call this script from your application.

You may refer to these posts for sample code.

http://stackoverflow.com/questions/527513/execute-powershell-script-from-c-sharp-with-commandline-arguments

http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
himanshu agarwal 31-Jul-15 2:21am View
   
It's in the same package.

http://neatupload.codeplex.com/SourceControl/latest#dotnet/app/Brettle.Web.NeatUpload/Demo.aspx.cs
himanshu agarwal 30-Jul-15 6:53am View
   
From the code I see, you are creating a TcpClient. If your question is how to use the same TcpClient object to send another message without recreating the instance, then, you need to store TcpClient instances in a List, say listOfActiveClients, then everytime before sending check if the client is connected or not, then send the data.
himanshu agarwal 30-Jul-15 6:48am View
   
Apologies, my bad, please try updated solution.
himanshu agarwal 30-Jul-15 5:54am View
   
Use TcpClient's Connected property to determine if the client is connected to host or not.
himanshu agarwal 30-Jul-15 5:43am View
   
If you use Sockets for communication then, you can use the Poll method to determine if the socket is connected or not.
himanshu agarwal 30-Jul-15 5:29am View
   
so basically you want to check if the client is connected or not before sending the message?

If yes, then you can queue the message and try sending, if client is disconnected or has closed the socket, then handle the exception and re-try.

Alternatively, in many architectures, it is client's responsibility to send keep-alive token to server at regular intervals so that server knows client is connected.
himanshu agarwal 30-Jul-15 5:10am View
   
I believe you are not importing a namespace there when you say System.Collections.Generic.List(Of System.String), you should just try aliasing to import System.Collections.Generic or System.Collections.Generic.List
himanshu agarwal 30-Jul-15 5:01am View
   
then, what's the problem here?
himanshu agarwal 30-Jul-15 4:30am View
   
MVC is just a design pattern, it only changes the abstraction level, but the essence should be the same.
himanshu agarwal 30-Jul-15 4:16am View
   
What did you try, a WIX setup?
himanshu agarwal 30-Jul-15 4:11am View
   
I did not get your point here, out of multiple clients that connect to server, if a client does not specify whom to send data, how will sever determine that? You need to tell this to server somehow or build that logic in server that will hardwire C1 with C2.
himanshu agarwal 30-Jul-15 2:13am View
   
You can put that information in the message body, the server can then parse this information from there. i.e.

C1 should send something like {"Receiver:"C2", "ReceiverIP":"a.b.c.d", "Message":"Hello, I am C1"}

then S can parse Receiver information and send the message to C2

{"Sender": "C1", "SenderIP": "1.2.3.4", "Message":"Hello, I am C1"}

Upon receiving this the client can parse the message and determine who sent the message and what is the message.

You may come up with a better architecture.
himanshu agarwal 30-Jul-15 1:17am View
   
Well you did not mention "web" in your question, but, apparantly if you are using ASP .NET controls you'd be setting the runat property to server (runat="server"). This ensures that any value change in the textbox will cause a postback and will also hit your TextChanged event where you can add the behavior you require.

https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.textchanged(v=vs.110).aspx
himanshu agarwal 28-Jul-15 4:15am View
   
This should help you. It has an example as well.

https://msdn.microsoft.com/en-us/library/456dfw4f(v=vs.110).aspx
himanshu agarwal 28-Jul-15 2:54am View
   
Hmmm, I went by what Josh said, that, only ContactType is not a string and I believe that is the place where the implicit typecast would fail.

If that is the case, I need not ask him to provide the Contact class or the custom collection he has defined.
himanshu agarwal 28-Jul-15 2:30am View
   
In essence, WriteLine automatically adds the new line after the text, you need not enter a newline. The reason it is not working is because what I mentioned above.
himanshu agarwal 28-Jul-15 2:28am View
   
This will not work as StreamWriter is being disposed after writing to the file. Next time while writing the second line, new StreamWriter will again point to start of file i.e. line 1.

You would need to seek to the end of file and then write in this case. That is what the overload of StreamWriter does.
himanshu agarwal 28-Jul-15 2:17am View
   
using (StreamWriter sw = new StreamWriter(@"C:\Users\MyPC\Desktop\test.txt", true))
{
sw.WriteLine(res);
sw.Flush();
}
himanshu agarwal 28-Jul-15 2:06am View
   
I just gave an example for the tool, different tools might have different ways to integrate. You may find a tool that supports command line and then invoke it from your routine.
himanshu agarwal 28-Jul-15 2:02am View
   
In case you want to write your own tool, you can take help from the suggestions here.

http://stackoverflow.com/questions/1348712/creating-a-sql-server-table-from-a-c-sharp-datatable
himanshu agarwal 28-Jul-15 1:51am View
   
There are tools to do that, you can use them or write your own.
Here's a tool which does that. http://dbweigher.com/dbwscript.php
himanshu agarwal 27-Jul-15 6:49am View
   
This will help you read tables from MS Access
http://stackoverflow.com/questions/1699897/retrieve-list-of-tables-in-ms-access-file

Once you have table schemas, you can create the same in SQL, then copy data.
himanshu agarwal 22-Aug-14 4:57am View
   
unless you are targeting any OS specific assembly, this should not be a reason.
himanshu agarwal 20-Aug-14 7:24am View
   
If the user/client is making modifications via your application then you may implement a custom service command to notify your service of the change.
himanshu agarwal 20-Aug-14 7:11am View
   
you may try to dump the response stream just to check if the data returned is correct?