|
Declare a local bool variable first and then set the variable to either true or false in the IF ELSE blocks. In the end return the variable
The code should look like the following...
bool ReadIni()
{
bool returnValue = false;
try
{
}
catch (Exception ex)
{
}
return returnValue
}
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Yeah, it never happened to me, but I realized that in case of an exception, that exception is caught and afterwards the application continues normally.
Thus in this case it also need a return value.
|
|
|
|
|
I have a project in C#. Now i have this problem: after installing this software it should be disabled and the user must register it in our website, then with an activation key that would be given in the website the software should be enabled again!
I really know nothing about how it should be done.
Would anybody please help me???
it's so urgent!!!
Roshanak
|
|
|
|
|
Urgent for who?
Simple: have the startup check for a value in the registry that is an anagram "satryuopoied". If it's not there phone home.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
yes, i found it.
now i have my own software, you mean if i install it (for example with windows installer) it creates this registry key for it's own and then i can do what i want??? or i must insert the creation of this key in my code????
Roshanak
|
|
|
|
|
Try googling registration-activation and similar terms.
Try looking on codeproject for registration-activation.
There is no fool-proof method - if there was M$ would use it already. Decide on a method that is good enough for your needs.
Simple approach is for the user to provide certain details and you give back a hash code based on the details. If the activation details and hashed code do not match the software say no!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I want to create binary file ex"test.dat" And want to write excel data in that how to do this?
Please help me with code
|
|
|
|
|
|
Hi guys,
I have written a simple console program which will accept username and display it. Now I want that along with this simple function, the program also copies itself to a particular location, say C:/Program Files. Such that the user need not copy and paste it to the above location systematically. Is the code something like this:
this.copy("C:/Program Files");
But this doesn't seem to work and I get errors. Whats the correct code for this then? Remember that I want the entire program to copy itself (replicate) to that location.
Your help will truly be admired,
Rajdeep.NET
|
|
|
|
|
Use setup to redirect your files to c:\Program Files.
*12Code
|
|
|
|
|
Will I have to create Setup for a small console application like this? Sorry, its my fault. Its a console program. Tell me how would I programetically do the stuff?
|
|
|
|
|
Please use setup. This is what the setup for. Setup is easy to create in VS, why not use it?
Program can't relocate itself to other location.
*12Code
|
|
|
|
|
Rajdeep.NET wrote: this.copy("C:/Program Files");
But this doesn't seem to work and I get errors
I do enjoy a good laugh in the mornings
You cant just write code like that and expect it to work. others i would frequently use...
this.FinishTheRestForMe();
And you certainly cannot move/copy an program that is running. As has been suggested you will want to use a setup for your requirements, even if its just a little console application.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
project stegnography for data hiding in midi
songs is excellent.
please send which algorithm it is used ,how key is working.please send
UML Diagrams and documentation of this project.
Thanking you.
|
|
|
|
|
More importatntly - why would you want to do this?
Assuming you have a valid reason, the only places where you could put your own data and still keep the file valid is in undefined Meta-Events or in a SysEx message. Google for MIDI file structure or MIDI file format.
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) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
There is this good article [^] about steganography in midi files. You may ask the author to provide you UML diagrams and documentation (or license, who knows...). I suppose you are ready to pay for that.
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]
|
|
|
|
|
project stegnography for data hiding in midi
songs is excellent.
please send which algorithm it is used ,how key is working.please send
UML Diagrams and documentation of this project.
Thanking you
|
|
|
|
|
Hmm...looks like you are packing your bags to reach moon.
Sit down with your teacher/ team members/ clients, analyze the requirements,get the documents done and then start to work on it. You can always use Google in the process. It's for Free!!
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
modified on Tuesday, April 28, 2009 1:20 AM
|
|
|
|
|
Hi guys,
I'm a little to new to SOAP Services but am having an issue trying to access a soap service by a third party vendor.
There service name is 'get-info' but when I import the WSDL into VS2008 it gets rid of the '-' so then service name becomes invalid. I asked them to change it but they said that due to their policies and other contractual restrictions, they won't.
I have got around it with a WebRequest/Response, but really want to get the this working.
Any help would be appreciated.
|
|
|
|
|
Hi,
What is differnece between Method Overlaoding and Method overriding in C#.net .Is that true overriding only allows in Inheritance ?
Best Regards
Rameez
|
|
|
|
|
Method Overloading
==================
It is possible to define the same function twice while using different parameters for each definition.
A same named function is defined more than once in your program resulting an overloading of function.
Method Overriding
=================
A class may override an inherited virtual method by declaring a method with the same name and signature, and marking the declaration with the override modifier.
override modifier replaces the inherited implementation of the method.
A DATAPOST COMPUTER CENTRE
(K.V Prajapati)
|
|
|
|
|
Any beginners' book will explain that.
|
|
|
|
|
Thanks for reply ,
One more question Method overriding only possible in Inheritance or we can also use it in Polymorphisim ?
Best Regards
|
|
|
|
|
Hello,
I'm trying to create a chart generator where random numbers define the chart coordinates.
As new values are added on the chart, the scrollbar appears and then scrolls automatically, pointing to the end of the chart, so the user can see the last data inserted.
The problem is that I'm inserting new values on the picturebox's image but after the scroll exceeds the original picturebox's size, it start repeating the image, instead of displaying the new values - it becomes just like a repeating scene on loop. I don't know what I can in order to solve that, I'd like to have the new values displayed on the image as the scroll continues.
The source code is below (sorry, but I don't know how to place it formatted here...):
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing.Imaging;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
private const int WM_SCROLL = 276;
private const int WM_VSCROLL = 277;
private const int SB_LINEUP = 0;
private const int SB_LINELEFT = 0;
private const int SB_LINEDOWN = 1;
private const int SB_LINERIGHT = 1;
private const int SB_PAGEUP = 2;
private const int SB_PAGELEFT = 2;
private const int SB_PAGEDOWN = 3;
private const int SB_PAGERIGTH = 3;
private const int SB_PAGETOP = 6;
private const int SB_LEFT = 6;
private const int SB_PAGEBOTTOM = 7;
private const int SB_RIGHT = 7;
private const int SB_ENDSCROLL = 8;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
List<point> pointList = new List<point>();
Graphics graphics;
Pen pen;
Random random = new Random();
int current = 0;
Point oldPoint = new Point();
Point newPoint = new Point();
Color bgColor;
Bitmap newBitmap;
public Form1()
{
InitializeComponent();
bgColor = Color.White;
pen = new Pen(Color.Black);
newBitmap = new Bitmap(pbChart.Width, pbChart.Height, PixelFormat.Format24bppRgb);
graphics = Graphics.FromImage(newBitmap);
graphics.Clear(bgColor);
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
}
void drawPoint(int px, int py)
{
newPoint.X = px;
newPoint.Y = py;
if (pointList.Count != 0)
{
oldPoint = pointList.Last();
}
else
{
oldPoint = newPoint;
}
pointList.Clear();
pointList.Add(oldPoint);
pointList.Add(newPoint);
if (px > pbChart.Width)
{
pbChart.Width += (px - pbChart.Width);
SendMessage(panel1.Handle, WM_SCROLL, (IntPtr)SB_RIGHT, IntPtr.Zero);
}
graphics.DrawCurve(pen, pointList.ToArray());
pbChart.BackgroundImage = newBitmap;
pbChart.Refresh();
}
private void timer1_Tick(object sender, EventArgs e)
{
drawPoint(current, random.Next(0, pbChart.Height));
current += 5;
}
private void btnPlayPause_Click(object sender, EventArgs e)
{
if (timer1.Enabled)
timer1.Stop();
else
timer1.Start();
}
}
}</point></point>
I guess that after the width is increased, the graphics width keeps the old one, so it does not show the new values, but I don't know how to overcome that, if that is the root cause of the problem.
Thanks in advance,
Regards,
Caio.
|
|
|
|
|
Dear,
I have one panel and set its BackgroundImage as Image1. When I use mouse over the panel, I want to see panel changes to Image2 and when I move mouse away from the panel, it shows the defualt image (Image1).
What I am going to do?
Thanks,
Visoth
|
|
|
|