|
Why would you need to do this??
|
|
|
|
|
so what your saying is you don't know...
|
|
|
|
|
Yes, I do know how to read/write disk sectors. No, I have no idea why he would want to do this.
|
|
|
|
|
well I do not know why he would want to read / write directly to the FAT / NTFS but I would like to tag files with extra infomation, that my compnay would find helpful...
so if you know how Ican do this from c# then that would be handy.
|
|
|
|
|
Hi,
Can anybody have anyidea about to get stream or video from a Ip Camera using URL in C#.Net
Thanks in advance.
Dinker
|
|
|
|
|
This question is incredibly confusing to me, define 'Ip Camera' (access a webcam remotely?) and what do you mean URL? Is it a video feed through the internet or through a network?
|
|
|
|
|
hi
with GraphicsPath.AddEllipse i created ellipse,if i use GetBounds() i get the bounds of the ellipse,
now if i want to rotate the ellipse keeping the same bounding rectangle how do i calculate the new ellipse to create?
|
|
|
|
|
Hello,
I have a problem, i have created a form and a user control. I have a database on SQL server. I have a combobox on my usercontrol and i would like to implement my combobox with my database. i've used the properties of the combobox to choose the datasource and choose my database and the right table but my combobox is empty.
Whereas if i create a combobox in my form and did the same things with my combobox i have the data inside.
I've tried lot of things but nothing is working , if someone know how to do this i would be very grateful
Thanks
|
|
|
|
|
Can we see some code to see where the error is?
|
|
|
|
|
I don't have any error, it just that i have no data in my combobox.
For the code i'm using the wizard datasource in the combobox propriété in Visual Studio.
The wizard create a dataset ( with the name of my database), a Bindingsource and a TableAdapter ( with the name of the table i want)
I can show you some code of one of this composant if you want?
Thanks
|
|
|
|
|
Without seeing how you're binding your data source to your control there could be many things going wrong...
|
|
|
|
|
this code can help you ?
It's in the designer of my combobox
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.licenceDataSet = new test_datasource.licenceDataSet();
this.companyBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.companyTableAdapter = new test_datasource.licenceDataSetTableAdapters.companyTableAdapter();
this.licenceDataSet1 = new test_datasource.licenceDataSet1();
this.companyBindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.companyTableAdapter1 = new test_datasource.licenceDataSet1TableAdapters.companyTableAdapter();
((System.ComponentModel.ISupportInitialize)(this.licenceDataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.companyBindingSource)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.licenceDataSet1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.companyBindingSource1)).BeginInit();
this.SuspendLayout();
this.comboBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.companyBindingSource, "nom", true));
this.comboBox1.DataSource = this.companyBindingSource1;
this.comboBox1.DisplayMember = "nom";
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(28, 24);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
this.comboBox1.ValueMember = "cid";
this.licenceDataSet.DataSetName = "licenceDataSet";
this.licenceDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
this.companyBindingSource.DataMember = "company";
this.companyBindingSource.DataSource = this.licenceDataSet;
this.companyTableAdapter.ClearBeforeFill = true;
this.licenceDataSet1.DataSetName = "licenceDataSet1";
this.licenceDataSet1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
this.companyBindingSource1.DataMember = "company";
this.companyBindingSource1.DataSource = this.licenceDataSet1;
this.companyTableAdapter1.ClearBeforeFill = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.comboBox1);
this.DataBindings.Add(new System.Windows.Forms.Binding("Tag", this.companyBindingSource, "nom", true, System.Windows.Forms.DataSourceUpdateMode.Never));
this.Name = "combo";
((System.ComponentModel.ISupportInitialize)(this.licenceDataSet)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.companyBindingSource)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.licenceDataSet1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.companyBindingSource1)).EndInit();
this.ResumeLayout(false);
|
|
|
|
|
hi
i am having a tree view having images as it nodes.
i am doin drag and drop using mouse events to the win form.(not using any drag drop events)
the thing i am to implememt is that i must be able to drag and drop across apllications(two instances of forms are running then i can drag from 1 and drop to 2 form);
thanks in advance
can any one help me regarding this
|
|
|
|
|
DoDragDrop() is the method you need to call to make this work. You can either put a string (of the filename of the image) into the drag drop object, or stuff the whole bitmap in, depending on whether you just want to drag between instances of your application, or with any app that supports dragdrop
|
|
|
|
|
Rahul106 wrote: not using any drag drop events
Why not use the supported events? They make drag and drop incredibly easy to implement, and trying to do it without using them means you're effectively writing them yourself anyway.
And, as benjymous mentions above, if you want to interact with other applications, you should definitely use them.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
hi all,
let's suppose
var result = DataContext.Student.Select(s=>s).ToList();
Can i store above 'result' into the an xml file?If yes then suggest me
thanks
|
|
|
|
|
Why not? You can store anything in an xml file. Just use your favourite flavour of XML serialization. Or just do it manually to make sure it works exactly the way you want it to work.
Your Select does not really make sense to me, why did you put that in?
|
|
|
|
|
after executing the query 'result' fills as
result[0].FName = A<br />
result[0].LName = X<br />
result[1].FName = B<br />
result[1].FName = y<br />
result[2].FName = C<br />
result[2].FName = y<br />
i just create xml file as
.......
....
........
<Student><br />
<FName> A </FName><br />
<LName> X </LName><br />
</Student><br />
<Student> <br />
<FName> B </FName><br />
<LName> y </LName><br />
</Student><br />
<FName> C </FName><br />
<LName> y </LName><br />
<Student>
or is it possible as DataSet directly create the xml file as
MyDataSet.WriteXml(Server.MapPath("MyXMLFile.xml"));
result.WriteXml..????
|
|
|
|
|
If you had googled you would have found DataSet.GetXml()
It returns a string, just write it to the file.
|
|
|
|
|
i don't want to use dataset
|
|
|
|
|
Alright up to you, you're just making it harder though
|
|
|
|
|
Hello!
I am trying to write an app that will read a file and generate an RFC 1321 compliant MD5 hash.
I have read a number of tutorials online and have been able to generate a compliant MD5 hash from a string, but I need to be able to pass my app a file and say "what is the MD5 hash of this file?".
Apparently I can read the file in to a byte array and then convert this to a string that my MD5 hash generator can read.
So far I have hit 2 problems:
- My byte[] conversion to string is resulting in an incorrect MD5 hash to all the web generators I have tried.
- I cannot read the byte[] of a file over 2 gigabytes (a buffering is needed I'm told?).
Any chance someone could help me out here? Ignore the part where I am setting the textbox.text value this was just for debug!
private void button1_Click(object sender, EventArgs e) {
Byte[] byteArray = File.ReadAllBytes("C:\\ITV-9C-28225-C.xml");
String stringFromByteArray = Convert.ToBase64String(byteArray);
textBox2.Text = MD5Hash(stringFromByteArray);
}
public static string MD5Hash(string text) {
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
return System.Text.RegularExpressions.Regex.Replace(BitConverter.ToString(md5.ComputeHash(ASCIIEncoding.Default.GetBytes(text))), "-", "");
}
Cheers in advance!
|
|
|
|
|
Well no wonder, you first make it into base64, and then use that as raw bytes - that does not make any sense in any way.
If you want to use ReadAllBytes, then at least pass the bytes to the MD5 object as bytes. Or if you have to use base64, decode it first
System.Security.Cryptography.MD5 has a ComputeHash which takes a Stream as argument.
|
|
|
|
|
Why you are converting the byte array into a base-64 string and then calculating the hash on the string? You can calculate the hash directly on the byte array, probably that is the reason because your hash in incorrect.
Also, why you are using Regex.Replace instead of the regular string.Replace?
For your 2nd problem, you can calculate the hash on a stream instead than on a byte array (that has a limit of 2Gb).
The following code summarizes what you have to do:
public static string MD5Hash(string filename)
{
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
using (Stream stream = new FileStream(filename, FileMode.Open, FileAccess.Read))
{
return BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", "");
}
}
Much simpler, don't you think?
modified on Friday, June 19, 2009 10:19 AM
|
|
|
|
|
Fantastic! Thank you so much for your help everyone this is working lovely
|
|
|
|