|
Use
BeginReceiveFrom
specify the remoteEP parameter as new IPEndPoint(IPAddress.Any, 0) . This will allow you to receive from any sending peer (or you can limit it here to receive only from specific address or port).
Then use EndReceiveFrom to find who's sent the packet. (details in documentation)
|
|
|
|
|
i was googling and found some thing interesting
it require adobe reader installed on our system
then go to tool box right click -> choose items
in com components go for adobe acro....
put hat on your form on the loading event of form just type
<br />
axAcroPDF1.LoadFile("your file name goes here");<br />
yeah i know you can make it sofisticated (using open file dialog box etc)
then what are you waiting for
|
|
|
|
|
Hello everybody in this great forum , it has been long time since i posted my last question. so here it goes .
i need to know how can i manupliate the current installed codecs for video capturing on the computer and then choose one from them to compress the video and then know how to use it to decompress and display the video image back to its original case ????
is there anyone can help me in this please.
Human knowledge belongs to the world.
|
|
|
|
|
I've been looking through my samples of code and my book but I can't find what I need.
I'm mainly wondering if I can convert string to int somehow...?
string tempValue;
string tempValue2;
string upc;
tempValue = upc.Substring(0, 1);
tempValue2 = upc.Substring(2, 1);
txtTempValue.Text = tempValue + tempValue2; //instead of displaying in 13 string format, I need 1 + 3 = 4, but below it must be in string format so that I can make sure the user entered it in a specific format: mmmppp-c
//Validate UPC format.
if (upc.Length != 8
|| upc.Substring(6, 1) != "-")
{
MessageBox.Show("UPC format is required in mmmppp-c format.",
Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
txtUpc.Focus();
return;
}
Whenever I try to convert string to int I keep recieving the message, cannot implicitly convert to string to int.
What I've tried that seemed like it should work::::
txtTempValue.Text = (decimal) tempValue + (decimal) tempValue2; //didn't work at all
Any help at all would be appreciated
|
|
|
|
|
decimal n = Convert.ToDecimal( tempValue);
led mike
|
|
|
|
|
Bobbydoo8 wrote: Whenever I try to convert string to int I keep recieving the message, cannot implicitly convert to string to int.
You can't implicitly convert a string to an int, so you have to do it explicitly:
int value = int.Parse(upc.SubString(0, 1));
What I've tried that seemed like it should work::::
txtTempValue.Text = (decimal) tempValue + (decimal) tempValue2; //didn't work at all
What you tried was a cast. Some data types can be cast to others, like casting an int to a double, but that is only allowed where the conversion is a simple. Parsing a string can be quite complicated, so that requires an explicit conversion.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much for the advice got them both to work correctly now with int value = int.Parse(upc.SubString(0, 1)); and decimal n = Convert.ToDecimal( tempValue);
You guys are awesome thank you very much, maybe now I can get my homework done.
|
|
|
|
|
Is there a way to do this? I havent been able to figgure it out? i would appreciate any help.
|
|
|
|
|
DataSet.ReadXml
led mike
|
|
|
|
|
I tried that, but it wont read the data file i have.
|
|
|
|
|
never mind....I forgot to initialize the dataset Variable. doh!
|
|
|
|
|
I'm sure I'm overlooking something embarrasingly obvious here, but...
In my VS 2003 projects, each file was wrapped in a common namespace. I typically derive a base page class from the system ui page, and then derive all my pages from it so that I can use it for common page code. No problemo.
However, I just discovered that VS 2005 doesn't wrap namespace code around all the pages. Consequently, when deriving my pages from my base page class, the compiler complains that it can't find a class or namespace matching the name the base page class I've created.
It was my understanding that everything was a member of the implicit global namespace, so I don't know why the class name isn't recognized. I put it in it's own .cs file & added to the project.
Anyway, I'm sure it's some glaring little thing I'm overlooking, but if someone could set me straight I'd be most grateful.
Thanks!
|
|
|
|
|
The "Web Site" project in VS05 is a fundamental shift in architecture from the web projects in VS03. The web site projects are operate less like applications and more like content managed web sites. Web pages get indivually compiled into their own dlls by default and as such, don't belong to a namespace. You could manually add namespaces and configure the project to compile to a single dll, however, I would recommend that you install the "Web Application" project, which didn't ship with VS05 but is available for download from:
http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx[^]
The Web Application project is more consistent with the VS03 web projects and is easier to manage as a complex application.
|
|
|
|
|
Thanks, Jim. That's useful info about web sites versus applications.
As it turns out, moving the .cs file to the App_Code folder makes it globally accessible. Not particularly intuitive, but kinda nice from a file management perspective.
|
|
|
|
|
I have a Sales Table with the following fields:
CustCode, ProdCode, Units, Price, Value
I fetch this data in a datatable with all fields.
now I want to make a dataview on that datatable with the following fields
ProdCode, Sum(Units) as units, Price, Sum(Value) As Value
means it contains data on product level.
is it possible to make a dataview with this grouping functionality.
Bye
Bye
|
|
|
|
|
|
Hi,
I am looking for a good example on how to create a Type-Ahead suggest textbox server control using DART Powerweb Live Controls. Does anyone have any suggestions? I am currently using ASP and C# to code my project. (VS and ASP .NET) I do not want to use AJAX
Thanks!
-- modified at 15:52 Friday 29th September, 2006
|
|
|
|
|
My suggestion is to go ask DART, not CodeProject.
|
|
|
|
|
Hello, I am currently needing to use CreateIPForwardEntry() to add an entry into the routing table. I have created a PMIB_IPFORWARDROW structure and I know that I've assigned something incorrectly but am not sure what it is. Can someone please take a look at this to see if you notice anything incorrect? I have a feeling it might be dwForwardMask - which I want to be 255.255.0.0
Thanks..
<br />
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]<br />
public struct PMIB_IPFORWARDROW<br />
{<br />
public UInt32 dwForwardDest; <br />
public UInt32 dwForwardMask; <br />
public UInt32 dwForwardPolicy; <br />
public UInt32 dwForwardNextHop; <br />
public UInt32 dwForwardIfIndex; <br />
public UInt32 dwForwardType; <br />
public UInt32 dwForwardProto; <br />
public UInt32 dwForwardAge; <br />
public UInt32 dwForwardNextHopAS;<br />
public UInt32 dwForwardMetric1; <br />
public UInt32 dwForwardMetric2; <br />
public UInt32 dwForwardMetric3;<br />
public UInt32 dwForwardMetric4;<br />
public UInt32 dwForwardMetric5;<br />
}<br />
...<br />
UInt32 uintO1, uintO2, uintO3, uintO4, dwForwardDest, dwForwardNextHop;<br />
<br />
uintO1 = Convert.ToUInt32("10");<br />
uintO2 = Convert.ToUInt32("30");<br />
uintO3 = Convert.ToUInt32("0");<br />
uintO4 = Convert.ToUInt32("0");<br />
dwForwardDest = (uintO1 << 24) + (uintO2 << 16) + (uintO3 << 8) + uintO4;<br />
<br />
uintO3 = Convert.ToUInt32("79");<br />
uintO4 = Convert.ToUInt32("5");<br />
dwForwardNextHop = (uintO1 << 24) + (uintO2 << 16) + (uintO3 << 8) + uintO4;<br />
<br />
PMIB_IPFORWARDROW pmibip = new PMIB_IPFORWARDROW();<br />
pmibip.dwForwardDest = dwForwardDest;<br />
unchecked<br />
{<br />
pmibip.dwForwardMask = (UInt32)((255 << 24) + (255 << 16) + (0 << 8) + 0);<br />
}<br />
pmibip.dwForwardPolicy = Convert.ToUInt32("0");<br />
pmibip.dwForwardIfIndex = dwForwardNextHop;
pmibip.dwForwardNextHop = dwForwardNextHop;<br />
pmibip.dwForwardType = 4;<br />
pmibip.dwForwardProto = PROTO_IP_NETMGMT;<br />
pmibip.dwForwardAge = 43200;
pmibip.dwForwardNextHopAS = 0;<br />
pmibip.dwForwardMetric1 = 1;<br />
<br />
int routeAddResult = IPHelper.CreateIpForwardEntry(ref pmibip);<br />
<br />
if (routeAddResult != (int)NO_ERROR)<br />
{<br />
if (routeAddResult == (int)ERROR_INVALID_PARAMETER)<br />
Console.WriteLine("An input parameter is invalid, no action was taken.");<br />
else if (routeAddResult == (int)ERROR_NOT_SUPPORTED)<br />
Console.WriteLine("The IPv4 transport is not configured on the local computer.");<br />
else<br />
Console.WriteLine("Error occcurred while creating new entry in routing table");<br />
}<br />
|
|
|
|
|
Hi, I am new to C# .Net and have a question. I am tryng to recursively search directories. I have found a bunch of examples. Most are done using a console application. I want to accomplish this task via the web (Web Application). Does anyone have example on how to loop recursively through directories on your hard drive and return the info to an aspx page? I will be looking for zip files and will want to put the file info into an array so I can loop through & return the information.
Thanks.
|
|
|
|
|
iamnew2C# wrote: how to loop recursively through directories on your hard drive?
iamnew2C# wrote: I have found a bunch of examples. Most are done using a console application.
Same way from a Web App (ASP.NET).
led mike
|
|
|
|
|
string []files =
System.IO.Directory.GetFiles(@"C:\SomeDir", "*.zip", System.IO.SearchOption.AllDirectories);
|
|
|
|
|
Thank you for your response. I forgot to specify we have not upgraded to the 2.0 framework.
System.IO.SearchOption opt = System.IO.SearchOption.AllDirectories; does not work.
My first attempt(b4 the post) was
DirectoryInfo di = new DirectoryInfo(@"C:\Temp");
foreach(DirectoryInfo file in di.GetDirectories())
{
Response.Write("Looking at file \""+file.FullName+"\""+" ");
}
But it this does not go into subdirectiories. Help.
Also, would you bind the result set to a data grid? What are the best option for displaying the result set to the web?
Thanks in advance.
|
|
|
|
|
Hi,
I want to write a self updating application. What can be the best approach? Whether i should go for Click once application deployment, or write my own code ( using BITS etc) or any other method. Please guide me in this regard.
Regards,
Wasif Ehsan.
|
|
|
|
|
I have a public field in my class
[XmlIgnore]
public string MyVar;
But at runtime I need to remove this decoration. Is there a way to remove it at runtime? I tried the attributes collection in the PropertyInfo. That doesn't work
Or if I could add the XmlIgnore at runtime. That would work also. But, the attributes collection doesn't allow me to do such a thing
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|