|
Recently, I was programming and my url changed...it has RANDOM characters in it. I don't know how or why it occurred. Has any one see this?
Normally, my url for a project would be http://localhost/MyProject/index.aspx
Now, it looks like this http://localhost/MyProject/(bi4dw4bxvmy2l345vfuixouc)/index.aspx
If I could remember what I had change in my project, I would change it back:<
Will-B-Confused
(help)
Thanks for any suggestions in advance...
|
|
|
|
|
It looks you have changed the web.config file to use cookieless sessions. The extra information is the SessionID. If you want to go back, go into your web.config file and look for sessionState. Change cookieless="true" to cookieless="false". That should get rid of the extra characters.
Happiness is knowing that somewhere out there, there is a bullet with your name on it.
|
|
|
|
|
John,
while I must confess you have a scary outlook on life, I am most appreciative of your excellent answer before your bullet arrived.
Thank you.
Willliam
|
|
|
|
|
Can any one explain when to use abstract class and when to use interface?
Or under which scenario we should use abstract class and interface.....
Zxczc
|
|
|
|
|
Generally, abstract classes are used when you have some implementation in the base class, which calls virtual methods that can be overridden in derived classes. Interfaces can't have implementation, so they can't be used there.
Also, interfaces can be used to express "can also be" kind of relationship. For eg, you can have a concrete class deriving from an abstract class and implementing IDisposable, so your class "can be" disposed.
Also, there are versioning issues. You can add additional virtual methods to abstract classes without breaking existing clients, you can't do that with interfaces.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Awesome answer/explaination!
Paul Lyons, CCPL Certified Code Project Lurker
|
|
|
|
|
Also, to add to the excellent Kumar answer, I'd add that formally, you should use an abstract class when the concrete class you'll implement is an specialization of the abstract one (aka "is a" relationship). When you define an interface, you often model an specific behavior (aka "-able" suffix: IDisposable, IClonable, IMovable, IComparable, IFormattable).
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
and INativeWindowable
(ok ok, I do agree with the above, but as always , there are scenarios when interfaces are used in the "is a" kind of way)
//Roger
|
|
|
|
|
|
Hi,
I am trying to fill a datagrid in ASP.NET, but i cant. What i need is to put some values on the datagrid, but the values are not coming from a database, i just need to set a fixed values. For example, i get the names of the columns(Name, Style) and i get the information of both columns:(John, Xtreme),(Paul, Overload). How do i set this information on a datagrid. Thank u very much for ur help
|
|
|
|
|
You can create a datatable in memory, there are plenty of examples on this. You can also databind to an array if you want to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am trying to find the accurate lastLogon for a user. I know that lastLogon is not replicated, so is possible to loop thru all the domain controllers in the domain without having to explicitly identifying each (by name)? An example in C# would be great.
thanks
rick
|
|
|
|
|
Hi,
I need to insert text and images together in a subitem in a listvew in C#. The images and the text can be in any position and any order in the subitem. The images need not be only at the start position of the subitem.
If any one has this kind of control do let know.
Any help will be great.
Thanx
Saleem
|
|
|
|
|
Hello,
I am doing a small application similar to the Windows Task Manager. In the Windows Task manager the first tab 'Applications' displays all the running applications in the system. I tried two ways to get running applications but each of my method had problems.
No.1
I got All the running processes
Process [] procs = System.Diagnostics.GetProcesses();
foreach(Process p in procs)
{
// I can get Handle and Title of the Main Window
// of each process and can
// display it.
someVariable = p.MainWindowHandle;
someVariable = p.MainWindowTitle;
}
Though the above method works fine for most processes, but for the processes like Explorer.exe or Winword.exe this method fails. Explorer.exe is running as a single process but have multiple Top-level windows associated with them. Similarly Winword.exe is only one process even if you have multiple word documents opened. In these cases
p.MainWindowTitle only gives me title for one window.
No.2
I also tried to Enumerate All thread Windows for each thread in every process through Win32 EnumThreadWindows(), then I checked each returned window using the GetParent() to check that if the application does not have a parent or owner then it is a Top-Level window and should be displayed in Task Manager. But in this case I get too many windows. I even get the Windows TaskBar window and a lot of other windows which are not actually applications (Windows Task Manager do not display them).
I even tried EnumWindows() and EnumDesktopWindows() but with similar results and getting too many extra windows which are Top-Level windows but are not applications.
Now, I guess that the Windows Task Manager gets this information about the running applications directly from the Windows Shell, but I dont know which shell interfaces will give me this information.
Can Anyone tell me how I can Enumerate the Running Applications exactly which are displayed in the Windows task manager. How I can do this in C# or in Win32 or any related Shell Interfaces.
How I can Enumerate All running Applications.
Thanx
|
|
|
|
|
Hello
I have a string, strUrval with the following data:
"tbOppningsDatumFrom=2004-10-10/uccontrol/tbimba=fpkepf/jaha/"
I do a String.Split to put data between the /'s in an array:
string strDelim = "/";
char [] delimiter = strDelim.ToCharArray();
string [] strUrvalSplit = null;
for (int x = 0; x < y; x++)
{
strUrvalSplit = strUrval.Split(delimiter,x);
}
this results in the following:
strUrvalSplit [0] = tbOppningsDatumFrom=2004-10-10
strUrvalSplit [1] = uccontrol
strUrvalSplit [2] = tbimba=fpkepf/jaha/
how come the string.split suddenly stops caring about the /'s ?
|
|
|
|
|
livez wrote:
string strDelim = "/";
char [] delimiter = strDelim.ToCharArray();
string [] strUrvalSplit = null;
for (int x = 0; x < y; x++)
{
strUrvalSplit = strUrval.Split(delimiter,x);
}
What is y?
you can do only
strUrvalSplit = strUrval.Split( delimiter );
David
|
|
|
|
|
dnh wrote:
What is y?
Y is the total number of /'s in the string:
int y = 0;<br />
char [] totAntal = strUrval.ToCharArray(); <br />
foreach( char c in totAntal )<br />
{ <br />
if (c == '/')<br />
{ <br />
y++; <br />
} <br />
}
dnh wrote:
you can do only
strUrvalSplit = strUrval.Split( delimiter );
okay thanks, Ill try it out.
edit: that solved my other problem as well, thanks alot =)
|
|
|
|
|
Hi,
I am trying to use a webservice hosted in a server from my laptop, but I keep getting the following error when adding the web reference:
'The request has exceeded the maximum time' or something like that
However, if I try to add a web reference to the web service 'latest' hosted here at the Code Project, it works fine.
Ideas? Any help would be appreciated
Thanks in advance
|
|
|
|
|
Are you able to invoke the webservice successfully from the browser? If your webservice url is services.asmx, you can try navigating to http://localhost/<your_webservice_dir>/services.asmx. That'll result in a page that'll allow you to invoke the web service's methods from the browser.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
If I Invoke the asmx file from the browser, be it in the server itself or in a client, I can actually see the list of web services provided.
Even from the VS IDE I get the list of web services, the problem is that it times out and the 'add reference' button is disabled, so I can't add it.
|
|
|
|
|
Kindly i want to know how to use window proc from within C# Application
is there any tutorial or somebody can help me in doing this
|
|
|
|
|
Just override WndProc in your class derived from System.Windows.Forms.Control . For example
class Test : Control
{
protected override void WndProc(ref Message m)
{
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Is there a way to add a new bar to the Outlook Navigation Pane. I have tried but have found out that only the shortcut bar is programmable. I know the Outlook object model doesn't allow us to do it but is there is any other way please let me know. Also i would like to show differet context menus when clicking on different calenda folders. Can anyone please help.I am working in C#.
Bikash Rai
|
|
|
|
|
(design pattern terminology newbie warning!)
I'm porting a sprite engine and multimedia toolbox, Endogine, which I've written in Director (see www.endogine.com) to C#, and I have to change the structure a bit because of the language differences.
In Lingo (Director's scripting language), it's possible to switch base classes in runtime, which is something I use a lot in Endogine.
Here's how:
The sprites can be rendered either by blitting bitmaps to the screen, or by using textured 3D planes. In the C# version, I support GDI+, DirectDraw and Direct3D.
Naturally, for each rendering method, different code is needed, and to solve this I've written a separate Sprite class (derived from the virtual SpriteBase) for each rendering method.
Now I want to derive other classes from these 3, say a BouncingSprite which moves around the screen. Depending on the rendering mode, a different base class must be used. In Lingo, I could define the base class in runtime (3D mode? OK, use Sprite3D as base class), but obviously this isn't allowed in C#.
Which is the most common way to go about this? (I don't just want it to work, I want it to use well-known design patterns
Interfaces could help, but I don't know much about them.
Should I avoid inheritance for the 3 types of rendering and write 3 separate "SpriteRenderMethodSpecific" helper classes (and a base class for them) so the Sprite class can choose which to instantiate in runtime? (Or is that pattern called Adapters..?)
TIA
|
|
|
|
|
I'm not a patterns expert, so there may be a better solution. But I'd probably use the "strategy" pattern.
Each of the three possible base classes must have the same interface, otherwise how are the derived classes going to cope with their bases being hot swapped from beneath them. So, create an interface for those calls. then create three classes that implement that interface (you could use an astract base class [ABC] in place of an interface if you prefer).
Then in what was your derived class create a member variable which is of the same type as the interface (or ABC). You can then create a method for instantiating the required concrete class so that you can call it at run time to swap the render methods around as needed. The constructor should call this instantiating method so that at least the class always has a valid render helper class. Each time you need to render something it calls through the interface (or ABC) to get at the correct functionality.
So...
interface IRenderHelper {}
class RenderTypeA : IRenderHelper{}
class RenderTypeB : IRenderHelper{}
class RenderTypeC : IRenderHelper{}
class BouncingSprite
{
IRenderHelper renderHelper;
void UseRenderTypeA()
{
renderHelper = new RenderTypeA();
}
void UseRenderTypeB()
{
renderHelper = new RenderTypeB();
}
void UseRenderTypeC()
{
renderHelper = new RenderTypeC();
}
}
Does that help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|