|
|
While a thank you is appreciated it is customary to award a good answer with a 5!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I don't know why PIEBald didn't get three 5's, so added a 5 of my own to his post
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
I have written a small webservice (C#) that gets a list of users from SQL Data Base all on my local machine (192.168.1.101). If I do:
-localhost:6035/service1.asmx (works)
-127.0.0.1:6035/service1.asmx (works)
-192.168.1.101:6035/service1.asmx (Doesn't work)
The goal I want to be able to access this webservice from my other machine on same network (192.168.1.102).
But, I have to get it to work on same machine first!
I tried the following so far with no success:
- I have turned off the firewall all the way.
- >route -p ADD 192.168.1.101 MASK 255.255.255.255 MASK 127.0.0.1
Anyone?
|
|
|
|
|
Which version of Windows are you on??
Have you tried the code from a different machine accessing the database on your machine??
|
|
|
|
|
Windows 7.
No. How do I do that?
I tried putting in 192.168.1.104 from my other machine, I got the default IIS7 page.
If I do 192.168.1.104:6035/Service1.asmx it stops working
|
|
|
|
|
Turning off the firewall on Windows 7 doesn't really open up all the ports on the machine. It's a bit of the opposite.
What do you mean "It stops working"?? What does it actually do? What are the error mesasges?
Do you have an exception put into the Win7 firewall for Inbound port 6035?
I think the URL should be closer to "http://192.168.1.104:6035/YourServiceProjectNameHere/Service1.asmx"
|
|
|
|
|
|
The above poster is correct. Basically, when you create a webservice "Service.asmx" on one machine, you need to publish it on IIS before you can get at it from another machine even if it is on same network. This link a step by step of how to get it published. http://a1ashiish-csharp.blogspot.com/2012/01/cnet-how-to-publish-web-service-in-iis.html[^]
Once published, You can do this from your other machine: http://192.168.1.101/YourWebServiceFolderUnderWWWRoot/Service.asmx
modified 8-Jun-12 22:14pm.
|
|
|
|
|
He doesn't have the same problem. From what I can tell, he's a spammer.
|
|
|
|
|
What is best way to develope MS Office solution for Excel 2003 using vs 2010 C#.
|
|
|
|
|
The quality of the answers you get is directly determined by the quality of the question you ask!
Open Visual Studio and start a new "Excel 2007 Add-In" or "Excel 2007 Template" project depending on what you want to do, then start coding.
|
|
|
|
|
I would but that will not work with office 2003!! using vs 2010, Slick. 
|
|
|
|
|
Whoops! Sorry, I missing that little detail!
You can't do it. Office 2003 is only targetable by VSTO 2005 which is only compatible with Visual Studio 2005 or 2008.
You cannot use Visual Studio 2010.
|
|
|
|
|
|
Create a Primary Interop Assembly (PIA) for Excel 2003, add it to the references of your project, and start coding.
|
|
|
|
|
For some reason, my seed is different, but it's still returning random numbers that are all 0. Here's the code. Any idea how to fix it? I want it to return 0 or 1.
private void btn_Program_Click(object sender, EventArgs e)
{
DateTime CurrTime = DateTime.Now;
int seed = CurrTime.Hour + CurrTime.Minute + CurrTime.Second;
Console.WriteLine("seed is" + Convert.ToString(seed));
Random randomNum = new Random(seed);
int randomNumber = randomNum.Next(0,1);
Console.WriteLine("Random Number Program Result: " + Convert.ToString(randomNumber));
}
The output for a couple of Program button clicks is:
seed is96
Random Number Program Result: 0
seed is50
Random Number Program Result: 0
|
|
|
|
|
Your call to Next:
int randomNumber = randomNum.Next(0,1);
will always return 0 because the lower limit (0) is INCLUSIVE, meaning it will be included in the possible range of values and the upper limit (1) is EXCLUSIVE, meaning that it will NOT be included in the range of possible values.
So, since Next always return an integer (whole number) and your result set goes from 0 to 0, your code will always return 0.
To return 0 or 1, you have to change the range to:
int randomNumber = randomNum.Next(0,2);
Try reading the documentation on Random.Next(int32, int32)[^].
If you want decimal values greater than or equal to 0 and LESS THAN (NOT EQUAL TO!) 1, you'll have to call Random.Double() instead. This will, of course, return a number of type double , not int .
Oh! and your "seed" value sucks if you're looking for anything close to "true" randomness. You're limiting yourself to only 936,000 different sequences of pseudo-random numbers.
Since the default constructor of Random will initialize the generator with the value in the system clock, it has the capability of generating 4.2 billion different random number sequences.
modified 8-Jun-12 14:08pm.
|
|
|
|
|
Dave Kreskowiak wrote: "seed" value sucks if you're looking for anything close to "true" randomness
I agree. He should also toss the day of the month in there as well, and if savvy enough with some assembly programming, grab the lower 32 bits of the RDTSC instruction (or play around with the QueryPerformanceCounter ) as well, that could lean in the direction of a bit more "random" seed...
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
MichCl wrote: Random randomNum = new Random(seed);
And that should be a field (perhaps static), not a metthod variable.
|
|
|
|
|
Hi CodeProject World,
How can i use TAPI for PBX via C# .
I wanna to have Caller Id and Transfer and Make Call from my PBX via TAPI and C#.
i have three line 101,102,103 from my PBX and 4 line in coming into PBX.
i have connected line 103 via Phone wire to my computer Modem .
We have 3 computers in our work office and all have connected to PBX via Modem .
Thanks in advanced !
|
|
|
|
|
TAPI might not come into play with this at all.
You have to dig out the documentation on your PBX system and find out if it exposes some kind of interface over that modem connection or some other connection you can use.
|
|
|
|
|
|
You linked to a Wiki page, not to an actual application or article.
That page lists a few drivers for specific PBX's. Do you have one of those??
This is where YOU do research, based on what YOU have and what YOU know. I'm not doing it for you and chances are really good that you're not going to find example code for exactly what you're looking for.
|
|
|
|