|
lulu0441 wrote: Can you do it in any ways?
Probably, but I won't. If people enable you to cheat now, things will only be rougher for you later on. Be responsible and do your own homework.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Go away.
|
|
|
|
|
static void Main()
{
System.Console.Writeline("I am trying to cheat on my homework");
}
|
|
|
|
|
Yeah, Lulu - that should do the trick.
|
|
|
|
|
hello everybody .
iam testing NAT Traversal through UPNP technology to negotiate with the NAT Router and Firewall but there is a problem in the Com Component that iam using from microsoft Which is located at System32 in your windows installation folder called UPNP.dll and Hnetcfg.dll
the problem is that i always have the collection with value Null that is why i can't be able to iterate through all static ports and ip address in my router (iam using Dial up connection not DSL)
here is the code that raise the problem
<br />
using System;<br />
using NatUpnp;<br />
<br />
namespace SnoutoOverride<br />
{<br />
class Nat<br />
{<br />
public Nat(){<br />
<br />
<br />
}<br />
<br />
private void InitializeNat(){<br />
<br />
IUpnpNat NatMgr = (IUpnpNat)new UpnpNatClass();<br />
<br />
foreach(IStaticPortMapping portmap in CurrentCollection)<br />
{<br />
}<br />
}<br />
}<br />
}<br />
The line Of code that has the many asterisks has the problem in which this returned collection is always be null that is why i can't iterate through the available external ip addresses or ports . so is there any solution regarding that . AT Msdn explains that but it doesn't seem that this collection returned with value null with them at all . If this problem is solved the whole problem will be vanished.
Is there any Solutions Freaks.
Human knowledge belongs to the world.
|
|
|
|
|
There could be many issues.
You should be discovering devices, not creating them. Do a DISCOVER for all nat devices on the network, then iterate to the correct one, and use that instance, to get more info (yes, the design of UPnP requires another call at this stage). then you should have the correct info.
That said, many UPnP devices arent using strict HTTP spec's and the UPnP.dll can fail sometimes. In that case you will have to write your own.
Other than that, have you looked ta Intel's UPnP tools? They written for .NET
|
|
|
|
|
thanks leppie for your great answer .
it is obviously clear that i can iterate through all Nat Devices on the network and it is really easy task but the problem in which --->what device i can choose (if i had many) and on what basis i choose my specific Nat Device that i will use for negotiatation in the network to open the ports
Human knowledge belongs to the world.
|
|
|
|
|
I'm doing development for a C# Windows Forms application. Currently, users are complaining of copy and paste problems on multiple forms. People are unable to copy and paste in some or all areas of the forms. It either throws an exception (see below) or the copy/paste box is grayed out.
System.Threading.ThreadStateException: The current thread must set to Single Thread Apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
at System.Windows.Forms.Clipboard.GetDataObject()
at C1.Win.C1Input.C1TextBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I have researched this alot and it seems to be some sort of Windows threading issue. The application is run via No Touch Deployment, which I think defaults to Multi Threaded Apartment, even if you start the app on a STA thread. I have a solution for the copying but I need to know how to hook it up to the Copy / Paste event in Windows forms....Is there a way you can override the Copy and Paste functions in a windows form? For example when you right click on a textbox and choose copy from that little context menu, Can I handle that click event on that menu some how? Could I override the Ctrl C key down call and hook up my own copy??????
This would be of MUCH help!!! Thanks guys
Daniel Gruszka
|
|
|
|
|
I have a couple of DataGridView refreshing problems.
The first one is how to get the datagrid to refresh the data the fastest. I used dataGridView1.Refresh() to refresh the data as it is coming in, but it causes the mouse to lag, without doing the refresh() the mouse and clicking capabilities are fine, but I cant see anything on the DataGridView unless I minimize the window and restore it (or anything that forces the control to redraw. I would like a faster method of updating the data that the DataGridView is using than the dataGridView1.Refresh().
The other problem I am having is when the DataSet table exceeds the size of the DataGridView. The sliders dont show up unless I resize the window. Even the dataGridView1.Refresh() doesn't update that. I want a way to explicitly tell the DataGridView that the size of the DataSet has exceeded its control size.
Any advice or help is much appreciated.
|
|
|
|
|
Well you hit it on the head, the refresh forces the repaint. When you minimize and resize it does pretty much the same thing.
I know of no other alternative than a refresh.
Are you populating the data in the grid in the same form? Is it a long operation to get the data? Watch out for a long operations in any method of the main form, it causes delays in the repaint logic. The application acts like it's dead for a while.
You can use delegates, and invoke.required checks to make it work better if it's a long operation.
|
|
|
|
|
Are you binding a DataGridView directly to a DataSet table instead of going through a BindingSource?
--
I've killed again, haven't I?
|
|
|
|
|
hello all,
I have been trying to make a program to shutdown my computer, i have the program on a timer and at a certian time i would like the program to shutdown my whole computer. i am planning on using it for when i am Burning dvds or listening to music before bed.
i know that the command prompt has a command to shutdown a computer:
/shutdown -s
where u can also use [-t XX] where XX is the time till it shutdowns.
Can someone please help me in this, either by using C to open and use command prompt by itself, or another way.
Thank you Very much.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|
|
In C#, you could simply call:
System.Diagnostic.Process.Start("shutdown.exe", "-s -f -t 00");
For more info, check this out: click here.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Thank you so so very much.
First time using this site and very impressed with the quick responce.
Thank you Jun Du.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|
|
You're welcome. Glad my answer is helpful.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Sorry to bother u even more, i ams ure u are very busy.
but if it isn't to difficult, is there a way to send the app to my notification area? Atm it is on my taskbar. If this requires a lot of coding and is very difficult please just skip this i do not want you to spend all your time on me. Thank you very much Jun Du.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|
|
oh sorry again, just at work atm and can not try out that code string u recommended i try. That is striaght C code right?
Sorry if this is a dumb question, i am new to C coding and only been doing it for about 8 month.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|
|
No. That was C# code. IF you're writing plain C you need to be asking in the c/c++ forum. C#'s a completely seperate language.
|
|
|
|
|
Thank you, i was hoping it would be similar. thank you.
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|
|
Though you are in the wrong forum, I will try. First of all, why this obsession with C? Why not a BAT file that has "/shutdown -s" typed in it, and use Windows Scheduler to run it whenevr you want?
OK, so you are the "I will write my own program" kind of addict. Why not use the WinExec() Win32 API to execute the same BAT file? Create the BAT file and keep it somewhere on the hard disk. Now in the C program (which can take parameters like timer duration etc - that is your design, you can even pass the full path & name of theBAT file if you want your program to be generic) that will simply execute the BAT file at the specified time.
Koushik Biswas
|
|
|
|
|
I am trying install my pc Reporting Service with Report Server and Report Manager. But an error occured when I install this program. I had installed SQL Server 2000 Developer Edition in my PC.
The error is:
"This edition of Report Server Database is not supported on edition of SQL Server 2000 you have chosen. Please choose another SQL Server that matches the requirements. "
What do I do? Please help....
Thank you...
This is my sign
|
|
|
|
|
I think you can check the reporting service requirement .It needs sql server 2000 with server pack3
|
|
|
|
|
Hi,
Scenario is
I have
=> App1 version 1.0 (developed with framework 1.1)
=> App1 version 2.0 (developed with framework 1.1)
now when i install version 1.0 into any machine it installs some files to GAC and to bin folders. At the same time i want to install App1 2.0, which also installs assemblies to GAC and same bin folder of 1.0 (target Installation path is same).
Will there be any problem running two versions parallally. My assumption is if two different versions have strong named assemblies with version numbers, there should be any problem, Any views pls welcome
kumar
|
|
|
|
|
Don't know for sure, but to be safe, put one in a different namespace.
|
|
|
|
|
I can't put in different namespace. Any other solution?
kumar
|
|
|
|