|
|
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.
|
|
|
|
|
Take a look at the System.Environment class, there's a property or function there that will do this directly. Can't remember what it's called though.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Yeah, I saw that, but I couldn't get it to work for me. I'm guessing it's because my service is running as a LocalSystem, and those settings only pull information when your program is running under a user account.
|
|
|
|
|
I'm trying to position a Windows MDI child form in a specific place in relation to other children. I'm setting the Location property prior to calling .Show(). Sometimes (every other time) it works. Sometimes it does not - the form is not positioned where I just said it should go.
Does anyone know how to make it work?
Jennifer
|
|
|
|
|
Have you tried changing the location in response to an event like "Form.Shown"?
|
|
|
|
|
I tried it, but it doesn't work quite right.
I had to do a funky work-around though, because the child form doesn't know where it's supposed to go - the parent is the only one aware of the other forms I'm trying to arrange. So the child notified the parent when it was shown and the parent repositioned the form. The problem is, the user sees the form move.
Thanks for the suggestion though. The next one did work, by the way. (Setting the start position to manual.)
|
|
|
|
|
With MDI I'm not sure, but have you tried changing the child form's StartPosition property to Manual?
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
Thanks! That did the trick. I thought I had tried that already, but I've done so many different things trying to make this work, that perhaps it was a different version of the form, or a different drawing mechanism. Regardless, it works like a champ now. Thanks again!
|
|
|
|
|
Hi! I am here again. I am not sure whether I should post this message at C# or ASP.NET. Anyway, I have a datagrid binded to sqlquery data. I want to do a report generation, when the user click the view report button, the datagrid will be transferedto another webform in C#.
I tried using Server.transfer(2ndpage); but it did not work.
thanks in advance. Much appreciated.
|
|
|
|
|
blurMember wrote: Server.transfer(2ndpage); but it did not work.
That is ASP.NET and don't tell them "it did not work" you need to be specific.
|
|
|
|
|
I will post the specific reply at ASP.NET. Thanks.
thanks in advance. Much appreciated.
|
|
|
|
|
Hi. I am currently doing a project using vb.net and c#. Is it possible to temporary remove certain collection item of dropdownlist?
is this the solution:
dropdownlist1.items.remove(items)?
what does (items) refers to?
thanks in advance. Much appreciated.
-- modified at 13:32 Wednesday 5th July, 2006
|
|
|
|
|
Hi all,
i made a simple proxyserver which can display basic HTML page at client site, but i have no idea why the image part of webpage always gone!!
following is my simple code which accept the request from client site, then reponse.
<br />
int port = 8080;<br />
Socket proxyServer = new Socket(AddressFamily.InterNetwork,<br />
SocketType.Stream,ProtocolType.Tcp); <br />
proxyServer.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 5000); <br />
<br />
proxyServer.Bind( new IPEndPoint(GetHostIP(), port) );<br />
proxyServer.Listen( port );<br />
<br />
Console.WriteLine("ProxyServer started at port " + port);<br />
Console.WriteLine("ProxyServer ready for accepting incoming connections..."); <br />
<br />
while(true)<br />
{<br />
Socket clientConnect = proxyServer.Accept(); <br />
NetworkStream clientStream = new NetworkStream( clientConnect, true ); <br />
<br />
HttpWebRequest loHttp = (HttpWebRequest) WebRequest.Create("http://www.google.co.uk/intl/en_uk/images/logo.gif");<br />
loHttp.Timeout = 10000; <br />
HttpWebResponse loWebResponse = (HttpWebResponse) loHttp.GetResponse(); <br />
<br />
System.IO.StreamReader loResponseStream =<br />
new System.IO.StreamReader(loWebResponse.GetResponseStream()<br />
, System.Text.Encoding.UTF8);<br />
<br />
<br />
Byte[] buf = System.Text.Encoding.UTF8.GetBytes( loResponseStream.ReadToEnd() );<br />
<br />
loWebResponse.Close();<br />
loResponseStream.Close();<br />
<br />
<br />
clientStream.Write(buf, 0, buf.Length);<br />
clientStream.Flush();<br />
clientStream.Close();<br />
}<br />
plz help me out~~
many thanks!
|
|
|
|