|
Hi!
I would like to make a program which will simulate some kind of shared folder.
So I can mount it and have "virtual drive".
Could some one give me some starting hint.
One is to study network file sharing protocol and than simulate that, but I hope there is some easier way.
For having a virtual drive I already look for "shell namespace extensions" in c++ & MFC but that just ain't that.
..:: Life Is Like A Box Of Ammo ::..
|
|
|
|
|
Hi. I am looking for a way to create a game trainer in C#.NET. That is to access the memory of a certain process (i.e. the game) and to modify some variables. I tried to use the Process class, but it is limited and has many security restrictions... I would even be happy to find a solution for this problem in C++...
Thanks in advance.
bunny EATING rabbit
|
|
|
|
|
|
Thanks a bunch man !! It was really helpfull !! I did it :> (next time i'll look harder )
bunny EATING rabbit
|
|
|
|
|
I have a class of UserControls all of which need to implement the same method.
I can achieve this with an abstract method
public abstract void foo();
However this has a disadvantage:
(A) There is some commonality in the code that it would make sense to extract and put into the base class.
I know that I can achieve this by
//Base
public virtual void foo
(
BaseCode();
)
//Derived
public override void foo
(
SomeCode();
base.foo();
)
But then that gives me 2 disadvantages
(B) It doesn't force a derived class to do it's own implementation of foo
(C) if the derived class doesn't explicitly call base.foo(); my common code doesn't get called.
Is there some other modifier or pattern I can use to achieve A, B, and C?
Or. Is there a good reason why I should not be trying to achieve this?
|
|
|
|
|
You can try splitting it up into three methods. One method has your base code. The other method is abstract and must be overridden by subclasses. And the last method calls the base code method first, then the abstract method.
Logifusion[^]
|
|
|
|
|
A, B:
If the method that you put in the base class doesn't fully implement what the method should do, you shouldn't implement it at all. Make it abstract, and put the code in a protected method that the derived classes can use to implement the abstract method.
C:
You can't force anything about how an overridden method is implemented. If you want some code to always be called from the method, let the derived class implement another method instead, that is used by that method:
Base class:
public void Foo() {<br />
FooTask();<br />
SomeOtherCode();<br />
}<br />
<br />
protected abstract void FooTask();
Derived class:
protected override void FooTask() {<br />
SpecificImplementation();<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
How do I convert an Image to a memory stream ? or better yet a byte[]? I've tried
Image tmp = ...
MemoryStream ms=new MemoryStream();
picLastSent.Image.Save(ms, ImageFormat.Jpeg);
But I keep getting a generic GDI+ exception.
I need it in byte[] format to send it out on a UDP multicast socket.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
hope it is helpful
sender:
MemoryStream ms = new MemoryStream();<br />
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
ms.Flush();<br />
Byte[] photo = ms.GetBuffer();
receiver(displayed by a picturebox control):
<br />
pictureBox1.Image=Image.FromStream(ms,false);
|
|
|
|
|
Nope it creahes on the Image.save call with a Generic GDI+ Exception.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
|
|
Hello,
I have 2 forms that i need to show the respective version in a dialog box or in another form.
something like this:
form1 version: 1.0.0.0
form2 version: 1.0.0.1
Cpyright..........
Im thinking to put in a class so that's any new form can use it.
Any idea?
Donkaiser
|
|
|
|
|
Hi!
You can access the version of the assembly your classes are in, but there is no way built in to have different versions for different types in the same assembly.
Take a look at the Assembly.GetName() method and the AssemblyName.Version property.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I am using the WebBrowser Control in my application and I need to somehow access the HTTP headers of the HTTP Request in order to obtain a cookie that is passed from the browser to the server during the submit. The cookie is a temporary one, it is not possible to access it on the file system because it doesn't get saved to a file.
Many thanks to anyone that can help,
Michael
|
|
|
|
|
Go through the DHTML interface to access the cookie.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
I'm trying to access the cookies found in the HTTP Request, I believe that what can be accessed through the DOM are the cookies that get returned in the Response. Any ideas?
Thanks,
Michael
|
|
|
|
|
They are the same. Whatever is in the browser cookie is what the browser sends in the HTTP header.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hello People, may be you can help me with this:
I've a winform with FormBorderStyle.None, and I want to set a background image. I want to use the image size as the winform size.
The problem is when I run the example, the size of the form is bigger than the image size, so I see a part of the winform with the background color.
Here is the code:
public FrmOne()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
this.StartPosition = FormStartPosition.Manual;
this.BackgroundImage = global::Project1.Properties.Resources.img_1;
this.Size = this.BackgroundImage.Size; // not work
//this.ClientSize = this.BackgroundImage.Size; // not work
this.StartPosition = FormStartPosition.CenterScreen;
//int x = Screen.PrimaryScreen.WorkingArea.Width - this.Width ;
//int y = Screen.PrimaryScreen.WorkingArea.Height - this.Height ;
//this.Location = new Point(x, y);
this.tmrTimer.Start();
}
Any ideas? Thanks a lot !!!
|
|
|
|
|
|
Hello,
It looks like you are placing the size change code inside the constructor for the form. I'm not quite sure why that isn't working, but in an application I am working on, I have initial resizing done inside the Load event handler and it works perfectly. Try putting your sizing code inside the Load event handler instead and see if that works out. For example:
private void FrmOne_Load(object sender, System.EventArgs e)
{
...
this.BackgroundImage = global::Project1.Properties.Resources.img_1;
this.ClientSize = this.BackgroundImage.Size;
...
} Hope that helps!
Sincerely,
Alexander Wiseman
|
|
|
|
|
I'm fairly new to C#, and I've never really written anything that relied on the microsoft api's before.
I'm currently writing a C# service, which I wish to have run as a LocalSystem. So far, so good. My problem is, I need to somehow monitor when a user logs on/off. I was hoping there would be some event firing I could listen to, but I can't seem to find one in the .NET framework. The computers the program will run on only allow one user being logged in at a time, so even simply making my own call or looking for a changed attribute value every few seconds would work fine.
I was looking at maybe doing a P/Invoke on user32.dll or kernel32.dll, but it looks rather complicated, and there's not alot of documentation I can find to help me there.
Any help would be appreciated.
- James Sheets
|
|
|
|
|
Login and logout are recorded in the security event log. Maybe you could use the System.Diagnostics.EventLog class to read event logs and dig out the ones for login and logout.
Logifusion[^]
|
|
|
|
|
Hmm. Something to think about I guess
Thanks.
|
|
|
|