|
|
hi i tried to go through that link but it wont help in my case
i want to read the string and image contents already stored in the reource file
eg if i am having name value
keyword case,if,else
then i want to read strvariable= resource1.keyword
its possible in c# i want to do it in vb.net pls help
with regards
Balagurunathan.B
|
|
|
|
|
will u send tyhe code C# code
or at
nilishgarg@yahoo.co.in
|
|
|
|
|
i saw that command in this article
http://www.codeproject.com/csharp/shadyrichtext.asp
using System;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Media;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
using System.Resources;
using System.Reflection;
using Microsoft.Win32;
using System.IO;
using System.IO.IsolatedStorage;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
namespace RTF_Parsing
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
#region Tables, Lists and Constants
#region Fonts
const string proportionalFontName = "Verdana";
const string monoFontName = "Courier New";
const string proportionalFontDefinition = @"{\f0\fnil\fcharset0 " + proportionalFontName + @";}";
const string monoFontDefinition = @"{\f1\fnil\fcharset0 " + monoFontName + @";}";
const int proportionalFontSize = 8;
const int monoFontSize = 9;
#endregion
#region Color Table
int[] rgbText = { 0, 0, 0 };
int[] rgbCharacter = { 128, 128, 128 };
int[] rgbShade = { 238, 238, 238 };
int[] rgbLiteral = { 144, 0, 16 };
int[] rgbComment = { 32, 128, 0 };
int[] rgbKeyword = { 13, 0, 255 };
int[] rgbClass = { 43, 145, 175 };
// It is useful to set up some aliases ...
public const string TX = @"\cf1 ";
public const string CH = @"\cf2 ";
public const string SH = @"\cf3 ";
public const string LI = @"\cf4 ";
public const string CO = @"\cf5 ";
public const string KY = @"\cf6 ";
public const string CL = @"\cf7 ";
// ... and their escaped versions
public const string escTX = @"\\cf1 ";
public const string escCH = @"\\cf2 ";
public const string escSH = @"\\cf3 ";
public const string escLI = @"\\cf4 ";
public const string escCO = @"\\cf5 ";
public const string escKY = @"\\cf6 ";
public const string escCL = @"\\cf7 ";
string colorDefinitions = "";
#endregion
#region ASCII Values
// Some ASCII constants
const char LF = (char)0x0A; // Line Feed
const char CR = (char)0x0D; // Carriage Return
const char Space = (char)0x20; // Space char
#endregion
#region Main Form Parameters
bool rtfvisible = false;
bool isFirstRun = true;
int maxFormHeight = 712; // Expanded
int minFormHeight = 568; // Not expanded
const int columns = 94; // Shading width
const string upArrow = "r";
const string downArrow = "s";
bool expanded = false;
#endregion
#region isoFiles
IsolatedStorageFile isoStore =
IsolatedStorageFile.GetStore(IsolatedStorageScope.User
| IsolatedStorageScope.Assembly, null, null);
const string isoF = "isolatedFirst.iso";
const string isoS = "isolatedSource.iso"; // Source
const string isoC = "isolatedClassList.iso"; // Class names
#endregion
#region Initialized Lists
string keywordList = "";
string unformattedClassList = "";
string formattedClassList = "";
#endregion
#endregion
// ----------------------------------------------------------------------------------------
// ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD ON LOAD
// ----------------------------------------------------------------------------------------
private void Form1_Load(object sender, EventArgs e)
{
// Startup screen
this.Height = minFormHeight;
btnArrow.Text = downArrow;
// Set Font properties for both Rich Text Boxes
rt1.Font = new Font(proportionalFontName, proportionalFontSize, FontStyle.Regular);
rt2.Font = new Font(monoFontName, monoFontSize, FontStyle.Regular);
rt1.Text = "";
t1.Visible = false; // t1 shows the background RTF encoding
string r = @"\red";
string g = @"\green";
string b = @"\blue";
string tx = r + rgbText[0].ToString() + g + rgbText[1].ToString() + b + rgbText[2].ToString() + ";";
string ch = r + rgbCharacter[0].ToString() + g + rgbCharacter[1].ToString() + b + rgbCharacter[2].ToString() + ";";
string sh = r + rgbShade[0].ToString() + g + rgbShade[1].ToString() + b + rgbShade[2].ToString() + ";";
string li = r + rgbLiteral[0].ToString() + g + rgbLiteral[1].ToString() + b + rgbLiteral[2].ToString() + ";";
string co = r + rgbComment[0].ToString() + g + rgbComment[1].ToString() + b + rgbComment[2].ToString() + ";";
string ky = r + rgbKeyword[0].ToString() + g + rgbKeyword[1].ToString() + b + rgbKeyword[2].ToString() + ";";
string cl = r + rgbClass[0].ToString() + g + rgbClass[1].ToString() + b + rgbClass[2].ToString() + ";";
// These colors will make up a new color table
colorDefinitions = tx + ch + sh + li + co + ky + cl;
// On first run, we will create in isolated storage
// a Class List (isoC) and a source file (isoS). The
// default, first run, source file content is a resource.
keywordList = Resources1.Keywords;
InitializeDataFiles();
}
resources one is resx file
with regards
Balagurunathan.B
|
|
|
|
|
Ex : in your MyForm application, you have a resources file which has values :
+ A string : MyID = "......."
+ An image : MyImage = "......."
you can try this :
'Declare an instance of resources
Dim MyResource As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(MyForm))
'Get string's value
Dim StrMyID as string = MyResource.GetString("MyID")
'Get image
Dim ImgMyImage as System.Drawing.Image = CType(MyResource.GetObject("MyImage"), System.Drawing.Image)
|
|
|
|
|
hi
thakns a lot for you . i have overcome my problem using your example but wat actually i tried was i added a resx file and tried to acces the resource from that file but failure only. while using form1.resx file i am able to do that.
normally if we add a item like 'form', 'class' etc we can acces like form1.show ,dim a as new class1 but resource1 (my resx file name) is not available in the list why?. do you have any idea .
with regards
Balagurunathan.B
|
|
|
|
|
hi
i stored the required string and its value in my main form form1.resx but it gets deleted whenever i close the dot net editor and reload the project . how i can resolve this
with regards
Balagurunathan.B
|
|
|
|
|
Hi ,
Im trying to transform an xml document with a style sheet that includes a vbscript file with vb script functions, using .net 1.1 and vb.net i get the following error when the code block attempts to transform the xml file.
The scripting language 'vbscript' is not supported.
Ive googled with very little help can someone please offer me a solution or advice !!
From my understanding this is .net security kicking in by not allowing server side scripts being included which may contain bad code nice but in this case its not helping me, in this case my intentions are good so i need this script to be trusted
Thank you in advance.
|
|
|
|
|
What is the code u r writing?
|
|
|
|
|
Hi,
Here is my code
Public Function TransformXml(ByVal InputXml As String, ByVal XSLPath As String) As String
Dim szResult As String = String.Empty
Dim objxml As New XmlDocument
Dim objxslt As New XslTransform
Dim writer As New StringWriter
Dim xmlreader = New XmlTextReader(XSLPath)
' Create a resolver with default credentials.
Dim resolver As XmlUrlResolver = New XmlUrlResolver
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
objxml.LoadXml(InputXml)
objxslt.Load(xmlreader, resolver)
objxslt.Transform(objxml, Nothing, writer, Nothing)
szResult = writer.ToString()
writer.Close()
Catch ex As Exception
Throw (ex)
End Try
Return (szResult)
End Function
|
|
|
|
|
My project uses vb.net/SQL server. Have implemented Webservices also.After publishing the Webservices, when i Update the web referrences that added in my project, I get the following error message
"An error occurred while parsing EntityName.Line 4,position 33".
When this happnes, then i will not be able to update .SO i delete the referrence and i add again. After that I just rebuild my project and it works fine.But every time i have to repeat the same thing(deleting and then adding the web referrences), when i publish my webservices.
Please help me to solve this issue.
Lakshmi
|
|
|
|
|
Hi!
I am doing a powerpoint automation via vb.net
A list of records in a grid (from sql server) is rendered into a 2 slided ppt template. each row represents 2 standard slides. The automation is quite slow if there are about 40-50rows in a grid as the final ppt will be 80-100 slides.
i automate the ppt on its minimized state. somewhere in a article i saw if i set its state to invisible it could be faster by 15% but when i set its property to invisible i get an error saying it cant be invisible. could someone give me an idea how could i get this automation more faster. currently if there are 30rows it takes about 1hr to render all those in powerpoint. I really need to speed up this process.
any help or idea on how to achieve this will be really great.
thanks in forward
|
|
|
|
|
does any one have any idea what i am talking about or they are just turning deaf to me?
|
|
|
|
|
how to integerate the .net framework into the setup project .every time i ma getting the same problem.
u need to install the .net framework 2.0.50525 to continue the setup.
curently i am including the
installer-6171-19-Microsoft-NET-Framework-2-0-50727-English.exe
is a 2.0.50525 .net framework
dotnetfx.exe
is 2.0 .net framework
|
|
|
|
|
You have to run the installer for .NET then run your msi. You can't integrate it unless you write your own program to run the installer, and it obviously needs to be in c++.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No No sorry boss , i did not mean that.
i was trying to get some information about the deploymnet steps in vb.net.
Ones i have created the deploymnet project for my application.
then i am getting the error that the deployment project does not contain the .net framework exe.
But i have added to it.
May be i was wrong in pursuing the right steps to create a deployment project.
Now what i wanted to ask is that is there any link that illustrates the deployment steps...... including the way how to add the .net framework exe.
|
|
|
|
|
I have a form in which i havea a Print Button and i also have three Printer in a lacal network.I wnat that when i press the Print button than all three pirnter print the data from database tables.Plz help me
-- modified at 3:13 Monday 14th May, 2007
suhail
-- modified at 5:44 Monday 14th May, 2007
|
|
|
|
|
You can get the names of all the installed printers from the System.Drawing.Printing.PrinterSettings.InstalledPrinters collection. Then in your printing code, you can set the PrinterName property of your PrinterSettings object to the name of the printer you want to print on. To start the printing code, all you have to do is call the Print method on your PrintDocument object.
|
|
|
|
|
Please can u? explaing me in detail with coding.
|
|
|
|
|
I don't have the time to put together a sample. I've already given you all the pieces you need, plus they double as search terms for use with MSDN or Google. You have to understand how the pieces work, then how they fit together. You'll be able to build this if you put the time into it.
|
|
|
|
|
How to get data in column from dataset?
i have data in dataset and i want data from some column in dataset.
|
|
|
|
|
dataset.tables(0).row(0).column(0).item(0).tostring()
|
|
|
|
|
Easy..
if (lv_DtSet.Tables[0].Rows.Count > 0)
{
foreach (DataRow lv_Row in lv_DtSet.Tables[0].Rows)
{
if (!Convert.IsDBNull(lv_Row["ColumnName"]))
String ColumnData = (String)lv_Row["ColumnName"];
}
}
"If our Mind can, the Program can !!" ≡ ░Ŗǿђầŋ٭ ≡
|
|
|
|
|
What is the difference in using the column index and the column name?
which one is advantageous?
-- modified at 2:11 Monday 14th May, 2007
|
|
|
|
|
Both have their own importance.
Lets consider an example
Suppose you are getting data from Database using a Stored procedure.
Stored procedure contains Select as..
Select ID, Name, Value from Table1
When you will use this DB procedure in the C#..
You have 2 options Either to get by Column name or by Index..
<br />
long id;<br />
String Name, Value;<br />
<br />
id = (long) lv_DtSet.Tables[0].Rows[0][0];<br />
Name = (String) lv_DtSet.Tables[0].Rows[0][1];<br />
Value = (String) lv_DtSet.Tables[0].Rows[0][2];<br />
<br />
id = (long) lv_DtSet.Tables[0].Rows[0]["ID"];<br />
Name = (String) lv_DtSet.Tables[0].Rows[0]["Name"];<br />
Value = (String) lv_DtSet.Tables[0].Rows[0]["Value"];<br />
Now, if you look at Index case you don't know which value u r retrieving.
So, if someday DB person changes sequence of columns say..
Select ID, Value, Name from Table1
you r in trouble. B'coz no exception will be raised.. bt Name and Value will get interchanged.
So I will prefer to use Column name in this case. B'coz Changing of column name in DB is less likely. And eventhough the Sequence of columns in Select query gets changed, u don't have to change your code.
But there are some times.. u don't know column names OR u want to read data serially Column1, column2 etc.. then use Column indexes.
Depends on situation.
But I will prefer to use Column name as far as possible.
And by the way its.. ROHAN
"If our Mind can, the Program can !!" ≡ ░Ŗổђầŋ٭ ≡
|
|
|
|