|
Not code, but if you cannot work this into code then i suggest you forget what your trying to do and start learning programming from the beginning...
create collection of DateTimes.
create DateTime as first of january for the desired year(from you param).
Start while loop.
if the year value of your DateTime is not the year value of your param then break the loop.
check if day if friday, if it is then store date in collection, then add 7 days to the DateTime.
else add oneDay.
end the loop.
return the collection.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Yes, here you are the code: #124fg@@!w .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi guys,
I´m gonna create a new project but I don´t now what technology I can use, because it´s a project that´s gonna have a dynamic menu, I´m gonna use PostGree DataBase, and I´m want to use ASP.Net C# ou VB...
Someone has some opinion about the architecture? For example: I´m thinking to use MVC framework... but I don´t know if it´s a better way..
Thanks a lot
|
|
|
|
|
Didn't work with the MVC yet, but it looks nice...
I think it all depends on your own favors, what you know already and if you have the time to learn something new.
Regards
Sebastian
|
|
|
|
|
There are many ways, and many patterns which you can use. But if I was in your place, I'd use the MVC model. It's simple and I guess it fits your requirements.
|
|
|
|
|
Can anyone know how to add a dropdownlist or a label inside a table that declare dynamically?
Here the code of what I understand.
Inside the HTML tag
<form id="Form1" action="TEST.aspx" runat="server"></form>
Inside the script tag using C#
void Page_Load(Object s, EventArgs e)
{
Table elbat = new Table();
TableRow record = new TableRow();
TableCell column = new TableCell();
Label ttt = new Label();
ttt.Text = "B";
column.Text = "A";
record.Controls.Add(column);
elbat.Controls.Add(record);
Form1.Controls.Add(elbat);
}
Basically, by doing
record.Controls.Add(ttt) cant be done with that
Thanks, in advance
|
|
|
|
|
hi
Does textbox have Autosize property?
one interesting subject
when i use Autosize property in win app there is but when i use in class library project there is not any property that named AutoSize
????
???
??
?
.
|
|
|
|
|
behzadcp wrote: Does textbox have Autosize property?
Nope.
behzadcp wrote: when i use Autosize property in win app there is but when i use in class library project there is not any property that named AutoSize
You might have mixed up classes. Are you using a label, or mayhaps setting the Form.AutoSize property by accident?
behzadcp wrote: ????
???
??
?
.
If you're lost, you can always check MSDN for information on the TextBox[^] component.
I are troll
|
|
|
|
|
No there isnt any inbuilt 'AutoSize' property for textbox but you can do some tricks. Here is one
write the following code in TextChanged and FontChanged events of TextBox.
Graphics g = Graphics.FromHwnd(IntPtr.Zero);
TextBox.Size = g.MeasureString(TextBox.Text, TextBox.Font).ToSize();
g.Dispose();
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
behzadcp wrote: Does textbox have Autosize property?
No.
behzadcp wrote: when i use Autosize property in win app there is but when i use in class library project there is not any property that named AutoSize
Not possible. The TextBox class is same be it win app or a class library.
Moreover, why would you need that?
With textboxes, you can always make it multiline, set WordWrap to true and set scrollbars property to Vertical.
If you need to grow/shrink the textbox with increase/decrease in the size of its container, then you should employ anchoring and docking.
जय हिंद
|
|
|
|
|
i am getting image based slideshow by using image list and picture box. i want it to make it more dynamic and flexible... I tried using "System.IO.Directory.GetFiles("C://MyPictures")"......So tat image files (after specifying the extension also ("*.jpeg"))can be extracted from the directory and be displayed as slideshow.....But its kinda not working out for me....need help !!!
**************************************************************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 3000;
timer1.Enabled = true;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
System.IO.DirectoryInfo dirInfo=new System.IO.DirectoryInfo("C://Images");
System.IO.FileInfo[] files=dirInfo.GetFiles("*.jpeg");
if(files!=null)
{
foreach(System.IO.FileInfo file in files)
{
pictureBox1.Image=Image.FromFile(file);
}
}
}
}
}
|
|
|
|
|
Hi,
Do you get a sepcific error message during comilation/runtime?
Try to use
<br />
pictureBox1.Image = Image.FromFile(file.FullName);<br />
FromFile accepts only the filename, not the FileInfo.
Regards
Sebastian
|
|
|
|
|
The most obvious thing here is that by putting all of the file fetching code inside the ontick handler, each time it fires, it gets all the files again and shows the first one every time (I think).
My suggestion, move
System.IO.DirectoryInfo dirInfo=new System.IO.DirectoryInfo("C://Images");
files=dirInfo.GetFiles("*.jpeg");
into Form_Load(), or other suitable place.
create System.IO.FileInfo[] files = null; as a field of the form.
add an index field int index = 0; as well.
Then in your ontick handler
if (files != null)
{
if (index >= files.Length)
{
timer1.Enabled = false;
}
else
{
pictureBox1.Image=Image.FromFile(files[index++]);
pictureBox1.Image=Image.FromFile(files[index++].FullName);
}
}
[MOD]
Realized I had forgotten the '.FullName' property
[/MOD]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Thursday, March 26, 2009 4:49 PM
|
|
|
|
|
dude d slideshow stops after d last image is read !!!
i want d slideshow to run continously .....plz help !!
|
|
|
|
|
i want d slideshow to execute continously in a repeated fashion and not stop after reading the last image. Is there any way i can do it ??
|
|
|
|
|
OK.
It's hard to be certain without seeing your code, but something like this should work.
Change the code of the ontick handler so it looks something like this:
if (files != null)
{
if (index >= files.Length)
{
timer1.Enabled = false;
index = 0;
}
else
{
pictureBox1.Image=Image.FromFile(files[index++].FullName);
}
}
All that this does, is detect when the last image has been used and resets the index back to the start.
Hope this helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I'm getting a NullReferenceException from the line "notify.SetNotificationPositions(bpnArray,3);" in the code below anyone got any idears.
code:
buffer = new Microsoft.DirectX.DirectSound.Buffer(bufferDescription, playbackDevice);<br />
<br />
bufferHalfEmptyEvent = new AutoResetEvent(false);<br />
<br />
bufferSize = buffer.Caps.BufferBytes;<br />
<br />
sinusBuffer = new MemoryStream(waveFormat.BlockAlign * waveFormat.SamplesPerSecond);<br />
<br />
BufferPositionNotify bufferOneThridPointNotify = new BufferPositionNotify();<br />
bufferOneThridPointNotify.Offset = bufferSize / 3 - 1;<br />
bufferOneThridPointNotify.EventNotifyHandle = bufferHalfEmptyEvent.Handle;<br />
BufferPositionNotify bufferTwoThridPointNotify = new BufferPositionNotify();<br />
bufferTwoThridPointNotify.Offset = (2*bufferSize / 3) - 1;<br />
bufferTwoThridPointNotify.EventNotifyHandle = bufferHalfEmptyEvent.Handle;<br />
BufferPositionNotify bufferEndPointNotify = new BufferPositionNotify();<br />
bufferEndPointNotify.Offset = bufferSize - 1;<br />
bufferEndPointNotify.EventNotifyHandle = bufferHalfEmptyEvent.Handle;<br />
<br />
BufferPositionNotify[] bpnArray = new BufferPositionNotify[3];<br />
bpnArray[0] = bufferOneThridPointNotify;<br />
bpnArray[1] = bufferTwoThridPointNotify;<br />
bpnArray[2] = bufferEndPointNotify;<br />
Notify notify = new Notify(buffer);<br />
notify.SetNotificationPositions(bpnArray, 3);
|
|
|
|
|
The only thing I can see is that maybe your offset calculations are causing a problem during the division process. It may be getting rounded down during. Set a breakpoint before or on SetNotificationPositions and check those values aren't <= 0
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Nope thats not it. Have tried with offset set to 10,20 and 30 same result. buffersize is 0x8000;
But thanks.
|
|
|
|
|
Which object is it saying is null?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
It doesn't say for some reason directX just throw a standard NullReferenceException.
|
|
|
|
|
From my delving into MSDN, the two parameters for SetNotificationPositions are:
dwPositionNotifies
Number of DSBPOSITIONNOTIFY structures.
pcPositionNotifies
Pointer to an array of DSBPOSITIONNOTIFY structures (the maximum array size is DSBNOTIFICATIONS_MAX).
So it looks to me like you have the params reversed.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I found that when I first looked. I think Microsoft.DirectX.DirectSound class wrapps this and provides
public void SetNotificationPositions(BufferPositionNotify[] notify, int numNotificationPositions);
Link[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Ain't MS wonderful.
My link is titled 'DirectX and XNA', so must be fairly recent, and yet yours gives a different answer.
I give up!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
When i try to transefer files using socket, the message is sending pary by part, so when in the reciving end the partial byte of the file making exception.
How can i send the byte[] in its full form, not part by part?
Thankyou
YPKI
|
|
|
|