|
if (!this.IsPostBack)
{
// Your code
}
The novice.
|
|
|
|
|
Hello,
Are System.Diagnostics.Debug methods automatically ignored by the compiler when DEBUG is not defined? Or do I still need to wrap it with a #if DEBUG ... #endif ?
I tried testing this by running a System.Diagnostics.Debug.WriteLine(...) on a Release run and it seems ok. I'm just having a problem when it comes to a release installer. Just wanted to make sure that this isn't the cause of the problem.
Thanks much!
~Rafferty
|
|
|
|
|
Rafferty Uy wrote: Are System.Diagnostics.Debug methods automatically ignored by the compiler when DEBUG is not defined? Or do I still need to wrap it with a #if DEBUG ... #endif?
Yes they are ignored. Most methods in Trace and Debug classes have the COnditionaAttribute set. If a method is called with this attibute and the value has not been defined, it will not be called (not even emitted). Pretty nifty, considering the other mentioned alternative
|
|
|
|
|
Great! Thanks for the confirmation leppie!
~Rafferty
|
|
|
|
|
Hello,
I'm posting what I hope will not be too ignorant of a question regarding com interop
A number of times I've seen in examples on this site a piece of code where the author has used com interop to call a method from an external dll (I assume c++ dlls being called from the c# code). My question is if you did not author the c++ dll yourself what is the best method to find out what the classes, methods, etc are that are contained in the dll? Basically, where do you determine what it is that you need to call from the dll?
For example, consider this call to an external dll (from an article here on Code Project):
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
How did the author determine that in the dll that he called that there is a WritePrivateProfileString method and that it takes 4 string parameters? Is there some utility out there that allows you to browse c++ dlls and that you can use to determine what method and parameters you would need to import?
Bear in mind that I'm still learning c# and com interop is one subject that I've struggled to understand fully.
Thanks.
|
|
|
|
|
The DLL has to be documented. That means, the signatures of the functions are described in a text file. MSDN contains a bit of documentation for all Win32 DLLs. If a DLL has no documentation, you're not supposed to use it.
Look, there are the MSDN pages for WritePrivateProfileString and the whole platform SDK.
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
-- modified at 17:10 Friday 14th April, 2006
|
|
|
|
|
Thanks 
|
|
|
|
|
Hi ppl,
I am trying to send a raw IP datagram, and I am having a problem with the insertion of the IP header.
Ideally I would like to send a datagram with my own header, because I would like to have a varying Protocol Field. However when sending the datagram I am forced to use the socket.Connect method because the .send requires an address, and this creates an IP header with an unmanagable Protocol Type Field.
For example the only way to put a TCP value (6) in the Protocol Field is to use
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.TCP);
and this creates a TCP header, which I dont want because I have my own header with different data already.
(btw i used ethereal to monitor the packets)
so....
If anyone could please suggest a way to either
modify the protocol type field, without creating any extra TCP or UDP headers..
(I have used setsocket options without success...)
or a way of sending the whole datagram including the IP header
10ks a lot guys
|
|
|
|
|
I am converting text to images in my c# code.
I want to generate an image for the word H20 with the 2 as a subscript.
The <sub>2</sub> doesnt work as the image is generated at the server and then send to the browser.
And Ideas?
|
|
|
|
|
I am toying with a poker program.
I would like to go into the visual area of the poker program's "form" and capture the upper left portion of the displayed card (approx 16 bits wide, 32 bits tall) ... from the place on the window (form) where the rank and the suit is displayed.
In effect, i would like to grab a 16x32 "selection area" like is typical in a "paint" program selection rectangle.
Once i capture it, i will label it, store it, and recall it so i can identify that specific card when it is displayed in the future.
I think i know how to locate the upper-left point (0,0) in the poker program's form, but i have no clue how to capture the 16x32 bit rectangle.
Any suggestions would be appreciated.
Thanks.
-- modified at 15:13 Friday 14th April, 2006
|
|
|
|
|
I am trying to build a component in which it can support all kinds of relation in two (DataGridView)s style and it has its own filtering, navigation ,edit,insert and delete buttons to support appropriate actions on bound data. So its better to accomplish these actions automatically than write "Update","Delete","Insert" commands manually.
I am in wonder whether SqlCommandBuilder does generate "Update","Delete","Insert" commands automatically in a master-detail relation or not ?
If it does or if there is any other way to handle the problem would you please let me know it either.
THANK YOU IN ADVANCED...
|
|
|
|
|
Greetings to all,
First, thank you for taking the time to read my post. I was wondering if it is possible to create a printer driver in C# that would actually save the output to an image file such as a TIFF as opposed to printing to a physical printer.
I am fairly new to .NET and Windows applications, so any help or references are greatly appreciated, especially regarding driver development. Is C#/.NET even the proper avenue for such a task?
Thanks in advance for any assistance or references.
|
|
|
|
|
C# is not the proper language to be writing drivers in. C# is a high-level, application programming language. Driver development is low-level close-to-the-hardware development more suited for a language like C.
|
|
|
|
|
Thanks for the quick response. I came across this KB article that will hopefully point me in the correct direction:
http://support.microsoft.com/kb/893388/en-us[^]
Hopefully this will help others seeking similar solutions.
Rock on CodeProject! 
|
|
|
|
|
Hello everybody!
I have two Forms! Form1 with the webBrowser Control and Form2 with a button.
I want to navigate the webBrowser1 Control by the click of the Button in Form2!
BUT HOW?
webBrowser1.Navigate("www.google") in the Form1_Load() works.
Form1 Frm1 = new Form1();
Frm1.webBrowser1.Navigate("url") -> doestn work!
|
|
|
|
|
Make your webBrowser1 variable public rather than private.
Or if you want to follow better encapsulation rules, make a public getter property that exposes the WebBrowser.
Better yet, add a public method called Navigate that accepts a string. Have that method call webBrowser1.Navigate.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: I luv teh choco
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hey, thanx so far...
I have:
on Form1:
public void navigate(string uri)
{
MessageBox.Show(uri);
webBrowser1.Navigate(uri);
}
on Form2:
Form1.navigate("http://www.google.de");
The MessageBox shows the string, but the content of webBrowser1 doesnt change...
___________
!bless you!
¯¯¯¯¯¯¯¯¯¯¯
|
|
|
|
|
If it's calling the navigate function, something else must be wrong. Either an error in your code, or a navigation problem with the web browser.
Keep in mind that MessageBox.Show is blocking, meaning webBrowser1.Navigate won't be called until the message box is closed.
|
|
|
|
|
if i call the function from the mainform, form2's webbrowser is changing the uri.... but if i call the function from form 2,, nothing happens.
___________
!bless you!
¯¯¯¯¯¯¯¯¯¯¯
|
|
|
|
|
I cannot find some C# code for ploting Bode diagram.I searched for a long time and soon I have to finish my work.Help please if anybody can.Best regards
|
|
|
|
|
how can i make program that will login in hotmail acount and take all email address in this email
--------------------
in othere words i have web site that have username as email and password
i want to program to test login to this account and all email address in this account
to send advertisment to this email
how can i do that ??
Palestine
|
|
|
|
|
Search for the Microsoft Passport SDK.

|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
There is a website which supports several languages.
I want to get the language of Windows OS.
Then the hyperlink could turn to different pages.
How to do this?
Thanks!
|
|
|
|
|
WTF are you talking about?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|