|
Thankxxxx but i am searching for Directory Attributes Readonly??
that means How to know Directory is writeprotected or Not??
Truth Is The Simplest !!!!
|
|
|
|
|
DirectoryInfo dirInfo = new DirectoryInfo(@"c:\temp");
if (dirInfo.Attributes == FileAttributes.ReadOnly)
{
}
|
|
|
|
|
Hello all
I have a problem in ComboBox Selecteditem, the DropDownStyle property for ComboBox is DropDownList and the datasource for ComboBox is Untype DataSet, and when I use Selecteditem property in comboBox the .NET compiler gave me error, and this is my code below:
---- Fill ComboBox From DataSet ---
DataSet dsAcc = new DataSet();
FillDsAcc(dsAcc);
if(dsAcc.Tables.Contains("ACCTYPE"))
{
CMBDecoreKind.DataSource=dsAcc.Tables["ACCTYPE"].DefaultView; CMBDecoreKind.DisplayMember="ACC_TYPE_DESC";
}
---- Set the CMBDecoreKind SelectItem ---
DataRow[] aRows=dsAcc.Tables["ACCTYPE"].Select("ACC_TYPE_ID=" + AccTypeID);
foreach (DataRow dr in aRows)
{
// CMBDecoreKind.SelectedItem = ((DataRowView) dr) ; // can't convert DataRow To DataRowView
}
The comment line "CMBDecoreKind.SelectedItem..." have a problem.
And the error message is:
Can anybody help me,
thanks in advance
modified on Monday, February 25, 2008 3:59 AM
|
|
|
|
|
I have a set of MP4 files on a remote FTP server. My application has to show a preview of that clips before user can download that. For displaying the preview, I am downloading the clip to a temporary location. This temporary file will be deleted once the preview finishes. But I feel insecurity in this method as user can copy the file from temporary location once they come to know the location.
I am looking for a method which I can get the video contents to a stream and supply that to the player. I am using windows media player wrapped int to my own custom control. Is there anyway to do this ? I am using WebClient class for accessing the file. It provides methods to read data to a stream, but I don't know how to set this to player. Any ideas ?
|
|
|
|
|
I think you need to use the HTTP, RTSP, or MMS protocols for WMP to support streaming. I think you should definitely look into hosting your files on a server with those protocols opposed to FTP. There might be a way to have an ASX file point to the files on the FTP server, but I'm not 100% sure of that.
Good Luck.
|
|
|
|
|
ChrisKo wrote: use the HTTP, RTSP, or MMS protocols for WMP to support streaming
That sounds great. I have some problem with using HTTP as users will be able to download the video directly from the server specifying URL. I will look into MMS and RTSP which is totally new to me. Thanks again.
|
|
|
|
|
call fortran dll winthin c#, when outnumbering, prompt:stack overflow
I don't know how to setup the size of stack in c#
|
|
|
|
|
The size of the stack is irrelevant, I reckon. Sounds like your code is getting into a recursive loop that doesn't end.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
when 3649*1824*sizeof(float),overflow
in fact,the amount is big
|
|
|
|
|
Hi all,
I have written a Application in C#. Its previous versions used to run on the Laptop.
However after including the dll(Interop.ActiveDs.dll) to find out the user name and the netId, the applciation fails to launch on several Laptops. however, few people are able to use it on thier PC's.
Does anyone have a clue as to why it does not work?
I ensured that .NET Framework is present on the Laptops. But it still does not work.
Thanks,
Nazia.
|
|
|
|
|
You need to provide more info than 'it fails to launch' and you need to work out what the machines it won't run on, have in common. It's not very probable that the issue is that they are notebooks.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello Christian,
The application works on few computers and does not work on the others.
I work on ASIA domain while the client for whom the application is written works in EUROPE domain. Even there, the application does not work on Laptop's.
I am not aware of what is amiss.
Can you tell me what are the features i need to look into?
Thanks.
|
|
|
|
|
Hello I'm working on a semi-script engine (using Reflection) and I have this class:
<code>
public enum LogicalOperator { EQL, NEQ, GTR, LSS, LEQ, GEQ };
public class Condition
{
public string instancename, fieldname;
public LogicalOperator logic;
public object value;
public Condition(string instancename, string fieldname, LogicalOperator logic, object value)
{
this.instancename = instancename;
this.fieldname = fieldname;
this.logic = logic;
this.value = value;
}
public Condition()
{
}
public bool Eval(object target)
{
object myValue = null;
try
{
myValue = target.GetType().GetField(this.fieldname).GetValue(target);
if (myValue == null)
{
myValue = target.GetType().GetProperty(this.fieldname).GetValue(target, null);
}
switch (this.logic)
{
case LogicalOperator.EQL: return myValue == this.value;
case LogicalOperator.NEQ: return myValue != this.value;
case LogicalOperator.GTR: return (float)myValue > (float)this.value;
case LogicalOperator.LSS: return (float)myValue < (float)this.value;
case LogicalOperator.LEQ: return (float)myValue <= (float)this.value;
case LogicalOperator.GEQ: return (float)myValue >= (float)this.value;
default: return false;
}
}
catch (NullReferenceException)
{
return false;
}
}
}
</code>
This works fine, but the problem is that I need some function like <i>GetObjectInstanceByName(this.instancename</i>), where instancename is a string and the return value is the instance as object.
I.e.: <i>Button myButton = GetObjectInstanceByName("Form1.button1") as Button;</i>
I've been surfering the net but I've don't found anything. How can I do this?
Thanks
|
|
|
|
|
You can call a constructor with reflection, I thought.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I don't want to create a new instance of a type, I want to reference an existing instance of any type, using its name as a string parameter.
|
|
|
|
|
Your best bet is to build a dictionary/hashtable mapping strings to objects, because you're not going to get that any other way.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
iam doing windows application c#
my database is "Firebird Database";
iam able to insert an picture into database,but iam unable to retrive the same..
my code is :
int id = int.Parse(textBox1.Text);
FbConnection cnn = new FbConnection("ServerType=1;User=SYSDBA;Password=masterkey;Database=E:/database/test.fdb");
cnn.Open();
string query = "select photo from cust1 where id=" + id;
FbDataAdapter adb = new FbDataAdapter(query, cnn);
DataSet ds = new DataSet();
adb.Fill(ds, "cust1");
DataRowCollection rdsrows = ds.Tables[0].Rows;
if (!rdsrows[0][0].Equals(DBNull.Value))
{
byte[] content = (byte[])rdsrows[0][0];
MemoryStream stream = new MemoryStream(content);
Bitmap img = new Bitmap(stream);-------------------"Error Here"
pictureBox1.Image = img;
}
it's giving error "parameter is not valid"
please inform where the problem is
murali krishna
modified on Monday, February 25, 2008 1:36 AM
|
|
|
|
|
Have you looked in the debugger to see what content looks like ? Compared it with the bytes of an image you're passing in ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
Thanks for your reply.
while saving content with in bytes is showing Dimensions{77500} like this
but while retriving content with in bytes showing Dimensions{13} only..
murali krishna
|
|
|
|
|
Well, gee, that seems like it could be a problem....
Sounds like your code to store the image is broken. I assume there's not more than 13 bytes in your database.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Try using Image instead of Bitmap.
Are you sure that the photo field type is BLOB (binary)?
I have no idea of what happens here, but I have some experience with Firebird in C# (sourceforge.net/projects/pokelib) and I wrote some functions for image conversion:
<br />
public static byte[] FileToBytes(string filePath)<br />
{<br />
FileStream fs;<br />
try<br />
{<br />
fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);<br />
}<br />
catch (IOException)<br />
{<br />
return null;<br />
}<br />
<br />
byte[] fileData = new byte[fs.Length];<br />
<br />
fs.Read(fileData, 0, System.Convert.ToInt32(fs.Length));<br />
<br />
fs.Close();<br />
return fileData;<br />
}<br />
<br />
public static Image FileToImage(string imagePath)<br />
{<br />
FileStream fs;<br />
try<br />
{<br />
fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);<br />
}<br />
catch (IOException)<br />
{<br />
return null;<br />
}<br />
<br />
byte[] imageData = new byte[fs.Length];<br />
<br />
fs.Read(imageData, 0, System.Convert.ToInt32(fs.Length));<br />
<br />
fs.Close();<br />
MemoryStream ms = new MemoryStream(imageData);<br />
return Image.FromStream(ms);<br />
}<br />
<br />
public static byte[] ImageToBytes(Image imageIn)<br />
{<br />
MemoryStream ms = new MemoryStream();<br />
imageIn.Save(ms, imageIn.RawFormat);<br />
return ms.ToArray();<br />
}<br />
<br />
public static Image BytesToImage(byte[] byteArrayIn)<br />
{<br />
MemoryStream ms = new MemoryStream(byteArrayIn);<br />
Image returnImage = Image.FromStream(ms);<br />
return returnImage;<br />
}
|
|
|
|
|
|
Hi all,
I am running SSIS package from C# that works fine if the stpes contains sql statements only,
but if some steps contain VB script or other language then it fails
can anybody tell me how to execute the SSIS package that contains combnation of steps and may be some steps contains VB script etc..
Thanks In advance....
vikas da
|
|
|
|
|
Hi,
I am having a problem that I have been trying to solve for the last 2 weeks. This might be seen in many travel sites like lastminute.com. The situation is simple. I need an indeterminate progress bar. I enter the search criteria/parameters (From/To Date & Destination) in page ‘A’. I click the search button now. I need to be transferred to Page ‘B’, which is empty but consists of a progress bar like image displaying any message and then I need to be transferred to page ‘C’ where the results will be displayed. I use the term “Indeterminate”, coz the progress bar is displayed based on the time taken (which can vary) to display the results and it not a fixed time interval(Usually with thread. sleep type) like u see in many sites. I am using VS 2005 + MS SQL 2005 + ASP.NET 2.0 + AJAX 1.0. Please help me out. Thank you
Regards,
balaji
|
|
|
|
|
The progress bar you're seeing is an animated gif. Add an animated gif to your page and show/hide it as you do your AJAX calls.
Please ask ASP.NET questions in the ASP.NET forum in future.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|