|
Anonymous wrote:
you can write property for setting/getting value of textboxt
Anonymous wrote:
can you show me how?
public string TextBoxText<br />
{<br />
set(this.textBox1.Text = value;)<br />
get{return this.textBox.Text;}<br />
}
|
|
|
|
|
KEF
|
|
|
|
|
|
Is that a new code in c 2.0 ?
|
|
|
|
|
Is there a good way to debug Client/Server code, or rather, code in general? I have not familiarized myself with the Debugging options and therefore have noticed some odd behaviors IE: in debug mode, the program acts a certain way, which is wholly different from the way it acts during regular execution. Any good articles regarding .NET debugging that could aid me? Thanks.
|
|
|
|
|
In Visual Studio, you can go into the properties of your solution that contains both client and server projects, and set the start-up project to include both client and server projects. That way, when you start debugging, both client and server will be launched under the debugger.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
You are running into the classic problem with these client-server systems. The Client and the Server are operating in different application domains that occationally overlap and communicate with each other. Trying to debug these types of systems requires a level of understand that goes beyond what is normally done in "regular execution". Objects are not automatically available to either domain. Paths as well as context sensitive information are not the same in either domain. So on and so forth.
It is almost always easier to debug the Client application domain. The development tools are often available as well as the process so you can just attach the debugger and go. The Server application domain is often unavailable especially when on another machine that might not even be on the same network. It is also often a very bad idea to stop the server application domain in mid processing since whatever resource is still waiting for it to complete, like IIS. Defer processing or delay too many of these and your server can start acting weird.
One trick I always like to do especially if IIS is available is to report right to the HttpContext which can be inspected by "Trace.axd". Another trick I've learned to use is to have extensive log files that are coded into the server portion.
|
|
|
|
|
|
Well I'm assuming that if you have the means of installing the software on the server you also have the means of reading a log file too. The trick is of course is that is that there are multiple processes loging events so you have to do some heavy filtering to get any meaning out of it.
|
|
|
|
|
GRRRR. WORK DAMMIT.
Right so im using this to get files from my rescources:
<br />
ResourceManager rm = new ResourceManager("MyApp", this.GetType().Assembly);<br />
globalvars.HouseImage = (Image)rm.GetObject("house");<br />
Now this works fine for my pictures and whatnot, but im also using DirectX to play my sounds (Damn right i got that working - no SDK)
so its just
<br />
music = new Audio(@"filename");<br />
music.Play();<br />
but how can i play the file in my resources, i cant use:
<br />
globalvars.music = (Audio)rm.GetObject("song");<br />
<br />
<br />
globalvars.music.Play();<br />
(well the code is accepted but when the app starts i just get the error message)
So HOW CAN I PLAY THE FILE (from my resources and not from an external folder)
and GRRRRRR once again
|
|
|
|
|
The problem is that you need to take your raw resource (an .mp3 file or similar) and generate a DirectX.AudioVideoPlayback.Audio object from it. I don't remember offhand, does Play() allow passing in a stream instead of a file name? From there, you could get your resource object as a byte[], put it in a stream, then play the song from there.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
Hi,
I get the following error in an application.
System.Runtime.InteropServices.COMException (0x80040154): ?
I have set up a test machine where I can reproduce the error and it seems to be at a point where I am using SQLDMO to connect to a database. The wierd thing is that it works fine on my machine but not on a workstation. the only difference between the machines as far as database is that I have SQL Server 7.0 on my machine and the test machine does not.
How can I find out what is needed to resolve this issue as far as files etc?
Thanks
|
|
|
|
|
0x80040154 is an HRESULT error that translates to "Class not registered."
Do you have MDAC[^] installed on the test machine?
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
MDAC installed fine when I installed the framework for .NET.
|
|
|
|
|
Then look for another object that is using COM. The HRESULT is very clear: the object you are looking for is not registered and therefore can not be created let alone call any function upon.
|
|
|
|
|
Hi all
i have a tab page form. One tab has a file dialog that searches for a file on a form, and the other tab has a treeview that is populated with icons. When the form closes and i try to relaunch the form the following code:
myImageList.Images.Add(new Icon(imageFolder + "button.ico"));
goes looking for the icons at the last location that the file dialog returned,.... Why?
confused
|
|
|
|
|
Is the RestoreDirectory property set to true?
From OpenFileDialog help:
Gets or sets a value indicating whether the dialog box restores the current directory before closing.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Your code should never assume that the current directory will never change. That's what happening after your file dialog closes. It's changed the current directory.
Let me guess, the value of imageFolder is just a directory name and not a full path?
You should be building a complete full path to any file that your application attempts to get. You could easily accomplish your posted task by creating a small method that returns the full path to the imageFolder directory:
public string GetImageFolderPath()
{
return Path.Combine(Application.StartupPath, imageFolder);
}
Even better, have your function build the complete path to the image file:
public string GetPathToImageFile(string filename)
{
return Path.Combine( Path.Combine(Application.StartupPath, imagefolder), filename);
}
Then all you have to do in your posted code is:
myImageList.Images.Add( new Icon( GetPathToImageFile("button.ico") ) );
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would to create a key (not a directory) within "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" path
RegistryKey myKey = Registry.LocalMachine;
myKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
myKey.CreateSubKey("MyKey");
myKey.SetValue("MyKey", Application.ExecutablePath);
i get exceprion on 3° line of code, and nothing is created, why?
|
|
|
|
|
|
|
|
Why are you writing to LocalMachine?
Do you have the permissions nessessary for this?
Cant you write to CurrentUser?
Will
|
|
|
|
|
I have an array of bytes which i need to get bits from in 5-bit chunks.
e.g. lets say my byte array has 4 values
0 - 10101010
1 - 10101010
2 - 10101010
3 - 10101010
i would like an array of strings (or whatever, could be bytes with leading 0) that returns to me the values
0 - (000)10101 (first 5 bits of 0)
1 - (000)01010 (last 3 bits of 0 and first 2 bits of 1)
2 - (000)10101 (mid 5 bits of 1)
.
.
so on
How can I do this in C#?
Thanks
|
|
|
|
|
Since that's only 32 combinations, why not use a lookup table? Then all you need to do is some bit shifting and and'ing.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|